Class ComplicationProvider
Definition
- Namespace:
- Tizen.Applications.WatchfaceComplication
- Assembly:
- Tizen.Applications.WatchfaceComplication.dll
- API Level:
- 6
Represents the complication provider for a service application.
C#Copypublic abstract class ComplicationProvider : IDisposable
- Inheritance
-
System.ObjectComplicationProvider
- Implements
-
System.IDisposable
Constructors
ComplicationProvider(String)
Initializes a new instance of the ComplicationProvider class.
Declaration
C#Copyprotected ComplicationProvider(string providerId)
Parameters
Type | Name | Description |
---|---|---|
System.String | providerId | The id of the complication provider. |
Examples
Copypublic 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. |
UnauthorizedAccessException | Thrown when the application does not have privilege to access this method. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/datasharing
Properties
Declaration
C#Copypublic string Id { get; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 6
Methods
Declaration
C#Copypublic void Dispose()
API Level: 3
Dispose(Boolean)
Releases the unmanaged resources used by the ComplicationProvider instance specifying whether to perform a normal dispose operation.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true for a normal dispose operation; false to finalize the handle. |
API Level: 3
Declaration
C#Copyprotected void Finalize()
GetEventComplicationType(ReceivedAppControl)
Gets the complication type of the received appcontrol.
Declaration
C#Copypublic 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
Copyprotected 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. |
API Level: 6
GetEventContext(ReceivedAppControl)
Gets the complication context of appcontrol that raises the event.
Declaration
C#Copypublic static Bundle GetEventContext(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
Bundle | The context of received event |
Examples
Copyprotected 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. |
API Level: 6
GetEventProviderId(ReceivedAppControl)
Gets the provider ID of appcontrol that raises the event.
Declaration
C#Copypublic static string GetEventProviderId(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
System.String | The target provider ID of received event |
Examples
Copyprotected 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. |
API Level: 6
Declaration
C#Copypublic static EventTypes GetEventType(ReceivedAppControl recvAppCtrl)
Parameters
Type | Name | Description |
---|---|---|
ReceivedAppControl | recvAppCtrl | The received appcontrol. |
Returns
Type | Description |
---|---|
EventTypes | The type of received event |
Examples
Copyprotected 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. |
API Level: 6
Declaration
C#Copypublic void NotifyUpdate()
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when the application does not have privilege to access this method. |
System.NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/datasharing
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
C#Copyprotected abstract ComplicationData OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
Parameters
Type | Name | Description |
---|---|---|
System.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 |