Class EventReceiver
Definition
- Namespace:
- Tizen.Applications.EventManager
- Assembly:
- Tizen.Applications.EventManager.dll
The ApplicationEventReceiver Class provides functions to add event handler.
C#Copypublic class EventReceiver : IDisposable
- Inheritance
-
objectEventReceiver
- Implements
-
System.IDisposable
Examples
Copyusing Tizen.Applications.EventManager.SystemEvents; void OnReceived(object sender, ApplicationEventArgs e) { if (e.Name == "event.org.tizen.example.AppEventTestApp.Tizen.Mobile.AppEvent") LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "On Received : " + e.Name); if (e.Name == EarjackStatus.EventName) { Bundle eventData = e.Data; object aValue = eventData.GetItem(EarjackStatus.StatusKey); if (eventData.Is<string>(EarjackStatus.StatusKey)) { string statusValue = (string)aValue; LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "EarjackStatus : " + statusValue); } } } public class EventManagerSample { ... EventReceiver receiver = new EventReceiver("event.org.tizen.example.helloworld.AppEvent"); receiver.Received += OnReceived; }
Constructors
Declaration
C#Copypublic EventReceiver(string eventName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | eventName | The interested event name. |
Properties
Declaration
C#Copypublic string EventName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Declaration
C#Copypublic void Dispose()
View Source
Dispose(bool)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | If true, disposes any disposable objects. If false, does not dispose disposable objects. |
Declaration
C#Copyprotected ~EventReceiver()
Events
Declaration
C#Copypublic event EventHandler<EventManagerEventArgs> Received
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><EventManagerEventArgs> |
Remarks
If you want to add the privileged event, you MUST declare right privilege first. Unless that, throw UnauthorizedAccessException. The privileged events are commented on remarks of it's definitions.
Implements
System.IDisposable