Show / Hide Table of Contents

    Class EventReceiver

    Definition

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

    The ApplicationEventReceiver Class provides functions to add event handler.

    public class EventReceiver : IDisposable
    Inheritance
    Object
    EventReceiver
    Implements
    IDisposable
    Examples
    using 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

    View Source

    EventReceiver(String)

    Initializer of class.

    Declaration
    public EventReceiver(string eventName)
    Parameters
    Type Name Description
    String eventName

    The interested event name.

    API Level: 6

    Properties

    View Source

    EventName

    Gets the eventname.

    Declaration
    public string EventName { get; }
    Property Value
    Type Description
    String
    API Level: 6

    Methods

    View Source

    Dispose()

    Release all the resources used by the class.

    Declaration
    public void Dispose()
    API Level: 5
    View Source

    Dispose(Boolean)

    Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    If true, disposes any disposable objects. If false, does not dispose disposable objects.

    API Level: 6
    View Source

    Finalize()

    Finalizer of class.

    Declaration
    protected void Finalize()
    API Level: 6

    Events

    View Source

    Received

    Occurs when events are received.

    Declaration
    public event EventHandler<EventManagerEventArgs> Received
    Event Type
    Type Description
    EventHandler<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.

    API Level: 6

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2022 Samsung
    Generated by DocFX