Class EditablesContainer
Definition
- Namespace:
- Tizen.Applications.WatchfaceComplication
- Assembly:
- Tizen.Applications.WatchfaceComplication.dll
- API Level:
- 6
Represents the editables container for a watch application.
public abstract class EditablesContainer : IDisposable
- Inheritance
-
EditablesContainer
- Implements
Constructors
View SourceEditablesContainer()
Initializes the EditablesContainer class.
Declaration
protected EditablesContainer()
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when some parameter are invalid. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
Methods
View SourceAdd(Complication, Int32)
Adds the Complication to edit list.
Declaration
public void Add(Complication comp, int editableId)
Parameters
Type | Name | Description |
---|---|---|
Complication | comp | The Complication object. |
Int32 | editableId | The editable id. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the invalid parameter is passed. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
API Level: 6
View SourceAdd(DesignElement, Int32)
Adds the DesignElement to edit list.
Declaration
public void Add(DesignElement de, int editableId)
Parameters
Type | Name | Description |
---|---|---|
DesignElement | de | The DesignElement object. |
Int32 | editableId | The editable id. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the invalid parameter is passed. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
API Level: 6
View SourceDispose()
Releases all resources used by the EditablesContainer instance.
Declaration
public void Dispose()
API Level: 3
View SourceDispose(Boolean)
Releases the unmanaged resources used by the EditablesContainer class specifying whether or not to perform a normal dispose operation.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true for a normal dispose operation; false to finalize the handle. |
API Level: 3
View SourceFinalize()
Destructor of the EditablesContainer class.
Declaration
protected void Finalize()
IsExist(Int32)
Checks whether editableId already exists in edit list.
Declaration
public bool IsExist(int editableId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | editableId | The target editable Id. |
Returns
Type | Description |
---|---|
Boolean | true if the editable already exists in edit list, otherwise false |
API Level: 6
View SourceLoadCurrentData(Int32)
Loads the editable's current data.
Declaration
public static Bundle LoadCurrentData(int editableId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | editableId | The id of the editable. |
Returns
Type | Description |
---|---|
Bundle | The editable's latest data that selected by editor. |
Remarks
This method loads the last editable data which is updated by editor application.
Examples
internal void InitEditables()
{
_container = new MyContainer();
Bundle curData = EditablesContainer.LoadCurrentData(_colorEditId);
List<Bundle> candidatesList = new List<Bundle>();
int curIdx = 0;
int i = 0;
foreach (string str in _colorArr)
{
Bundle data = new Bundle();
data.AddItem(_colorKey, str);
candidatesList.Add(data);
if (curData != null && curData.GetItem(_colorKey) != null
&& curData.GetItem(_colorKey).Equals(str))
{
curIdx = i;
}
i++;
}
ColorDesign colorEdit = new ColorDesign(candidatesList, curIdx, "COLOR", _complicationBtn);
colorEdit.Highlight = new Highlight(ShapeType.Circle, 0, 40, 10, 10);
_container.Add(colorEdit, _colorEditId);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when some parameter are invalid. |
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
API Level: 6
View SourceOnEditReady(String)
Overrides this method if you want to handle the behavior when the editor is ready to edit.
Declaration
protected abstract void OnEditReady(string editorId)
Parameters
Type | Name | Description |
---|---|---|
String | editorId | The appid of ready to edit editor. |
API Level: 6
View SourceRemove(Int32)
Removes the editable from edit list.
Declaration
public void Remove(int editableId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | editableId | The editable id. |
Examples
if (myContainer.IsExist(_colorEditId)
myContainer.Remove(_colorEditId);
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the invalid parameter is passed. |
API Level: 6
View SourceRequestEdit()
Requests edit to editor application.
Declaration
public void RequestEdit()
Examples
public class MyContainer : EditablesContainer {
public MyContainer() : base()
{
}
protected override void OnEditReady(string editorId)
{
this.RequestEdit();
}
}
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the method failed due to invalid operation. |
NotSupportedException | Thrown when the watchface complication is not supported. |
UnauthorizedAccessException | Thrown when the application does not have privilege to access this method. |