Class ComplicationProvider

    Definition

    Namespace:
    Tizen.Applications.WatchfaceComplication
    Assembly:
    Tizen.Applications.WatchfaceComplication.dll

    Represents the complication provider for a service application.

    public abstract class ComplicationProvider : IDisposable
    Inheritance
    object
    ComplicationProvider
    Implements
    System.IDisposable

    Constructors

    View Source

    ComplicationProvider(string)

    Initializes a new instance of the ComplicationProvider class.

    Declaration
    protected ComplicationProvider(string providerId)
    Parameters
    Type Name Description
    string providerId

    The id of the complication provider.

    Examples
    public class MyComplicationProvider : ComplicationProvider
    {
        public MyComplicationProvider(string providerId)
         : base(providerId)
        {
        }
        protected override void OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
        {
        }
    }
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when providerId is invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    System.UnauthorizedAccessException

    Thrown when the application does not have privilege to access this method.

    Properties

    View Source

    Id

    Gets the provider ID.

    Declaration
    public string Id { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    Dispose()

    Releases all resources used by the ComplicationProvider class.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Releases the unmanaged resources used by the ComplicationProvider instance specifying whether to perform a normal dispose operation.

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

    true for a normal dispose operation; false to finalize the handle.

    View Source

    ~ComplicationProvider()

    Destructor of the provider class.

    Declaration
    protected ~ComplicationProvider()
    View Source

    GetEventComplicationType(ReceivedAppControl)

    Gets the complication type of the received appcontrol.

    Declaration
    public static ComplicationTypes GetEventComplicationType(ReceivedAppControl recvAppCtrl)
    Parameters
    Type Name Description
    ReceivedAppControl recvAppCtrl

    The received appcontrol.

    Returns
    Type Description
    ComplicationTypes

    The target complication type of received event

    Examples
    protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
    {
        ComplicationTypes type = ComplicationProvider.GetEventComplicationType(e.ReceivedAppControl);
        base.OnAppControlReceived(e);
    }
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when e is invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    View Source

    GetEventContext(ReceivedAppControl)

    Gets the complication context of appcontrol that raises the event.

    Declaration
    public static Bundle GetEventContext(ReceivedAppControl recvAppCtrl)
    Parameters
    Type Name Description
    ReceivedAppControl recvAppCtrl

    The received appcontrol.

    Returns
    Type Description
    Bundle

    The context of received event

    Examples
    protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
    {
        Bundle context = ComplicationProvider.GetEventContext(e.ReceivedAppControl);
        base.OnAppControlReceived(e);
    }
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when e is invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    View Source

    GetEventProviderId(ReceivedAppControl)

    Gets the provider ID of appcontrol that raises the event.

    Declaration
    public static string GetEventProviderId(ReceivedAppControl recvAppCtrl)
    Parameters
    Type Name Description
    ReceivedAppControl recvAppCtrl

    The received appcontrol.

    Returns
    Type Description
    string

    The target provider ID of received event

    Examples
    protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
    {
        string providerId = ComplicationProvider.GetEventProviderId(e.ReceivedAppControl);
        base.OnAppControlReceived(e);
    }
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when e is invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    View Source

    GetEventType(ReceivedAppControl)

    Gets the received event type.

    Declaration
    public static EventTypes GetEventType(ReceivedAppControl recvAppCtrl)
    Parameters
    Type Name Description
    ReceivedAppControl recvAppCtrl

    The received appcontrol.

    Returns
    Type Description
    EventTypes

    The type of received event

    Examples
    protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
    {
        EventTypes type = ComplicationProvider.GetEventType(e.ReceivedAppControl);
        if (type == EventTypes.EventDoubleTap)
        {
            // do something
        }
        base.OnAppControlReceived(e);
    }
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the invalid parameter is passed.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    View Source

    NotifyUpdate()

    Emits the update event for complications.

    Declaration
    public void NotifyUpdate()
    Exceptions
    Type Condition
    System.UnauthorizedAccessException

    Thrown when the application does not have privilege to access this method.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    View Source

    OnDataUpdateRequested(string, ComplicationTypes, Bundle)

    Overrides this method to handle the behavior when the event for requesting the update of complication data comes from watchface complication.

    Declaration
    protected abstract ComplicationData OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
    Parameters
    Type Name Description
    string reqestAppId

    The ID of application which sent update request.

    ComplicationTypes type

    The requested type.

    Bundle contextData

    The complication's context which is set by complication setup application.

    Returns
    Type Description
    ComplicationData

    The requested ComplicationData

    Implements

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