Class ApplicationEventManager

Definition

Namespace:
Tizen.Applications.EventManager
Assembly:
Tizen.Applications.EventManager.dll
API Level:
6

The EventManager Class provides functions to broadcast user-defined event.

C#
Copy
public static class ApplicationEventManager
Inheritance
System.Object
ApplicationEventManager
Examples
Copy
public class EventManagerSample { /// ... Bundle bundle = new Bundle(); bundle.AddItem("key", "value"); ApplicationEventManager.Publish("event.org.example.helloworld.event, bundle); }

Methods

View Source

KeepLastEvent(String)

Keeps last User-Event data for receiver applications.

Declaration
C#
Copy
public static void KeepLastEvent(string eventName)
Parameters
Type Name Description
System.String eventName

The event's name to send.

Remarks

The receiver applications will receive this last event data after adding their new handlers via ApplicationEventReceiver since the sender application called this method. If a sender application sends same event via trusted method and non-trusted method, then a trusted receiver will get latest data regardless of trusted or non-trusted, but non-trusted receiver will get the last data only from non-trusted method. The effect of this API continues during runtime. That means when the sender application process restarts, the sender application needs to call this api again to make the event to keep the last event.

Exceptions
Type Condition
System.ArgumentException

Thrown in case of an invalid parameter.

System.InvalidOperationException

Thrown in case of any internal error.

API Level: 6
View Source

Publish(String, Bundle)

Sends the User-Event to receiver applications.

Declaration
C#
Copy
public static void Publish(string eventName, Bundle eventData)
Parameters
Type Name Description
System.String eventName

The event's name to send.

Bundle eventData

The event's data to send.

Remarks

The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, If the event_name is invalid, throw InvalidOperationException

Exceptions
Type Condition
System.ArgumentException

Thrown in case of an invalid parameter.

System.InvalidOperationException

Thrown in case of any internal error.

API Level: 6
View Source

Publish(String, Bundle, Boolean)

Sends the User-Event to trusted receiver-applications.

Declaration
C#
Copy
public static void Publish(string eventName, Bundle eventData, bool isTrusted)
Parameters
Type Name Description
System.String eventName

The event's name to send.

Bundle eventData

The event's data to send.

Boolean isTrusted

Whether the event is trusted or not.

Remarks

The application which has same certification with sender can receive the event. The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, If the event_name is invalid, throw InvalidOperationException

Exceptions
Type Condition
System.ArgumentException

Thrown in case of an invalid parameter.

System.InvalidOperationException

Thrown in case of any internal error.

API Level: 6