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.
public static class ApplicationEventManager
- Inheritance
-
ApplicationEventManager
Examples
public class EventManagerSample
{
/// ...
Bundle bundle = new Bundle();
bundle.AddItem("key", "value");
ApplicationEventManager.Publish("event.org.example.helloworld.event, bundle);
}
Methods
View SourceKeepLastEvent(String)
Keeps last User-Event data for receiver applications.
Declaration
public static void KeepLastEvent(string eventName)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
ArgumentException | Thrown in case of an invalid parameter. |
InvalidOperationException | Thrown in case of any internal error. |
API Level: 6
View SourcePublish(String, Bundle)
Sends the User-Event to receiver applications.
Declaration
public static void Publish(string eventName, Bundle eventData)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
ArgumentException | Thrown in case of an invalid parameter. |
InvalidOperationException | Thrown in case of any internal error. |
API Level: 6
View SourcePublish(String, Bundle, Boolean)
Sends the User-Event to trusted receiver-applications.
Declaration
public static void Publish(string eventName, Bundle eventData, bool isTrusted)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|
ArgumentException | Thrown in case of an invalid parameter. |
InvalidOperationException | Thrown in case of any internal error. |