Class ApplicationEventManager
Definition
- Namespace:
- Tizen.Applications.EventManager
- Assembly:
- Tizen.Applications.EventManager.dll
The EventManager Class provides functions to broadcast user-defined event.
public static class ApplicationEventManager
- Inheritance
-
objectApplicationEventManager
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 |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
System.InvalidOperationException | Thrown in case of any internal error. |
Publish(string, Bundle, bool)
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. |
bool | 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. |
Publish(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 |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
System.InvalidOperationException | Thrown in case of any internal error. |