Class EditablesContainer

    Definition

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

    Represents the editables container for a watch application.

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

    Constructors

    View Source

    EditablesContainer()

    Initializes the EditablesContainer class.

    Declaration
    protected EditablesContainer()
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when some parameter are invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    Methods

    View Source

    Add(Complication, int)

    Adds the Complication to edit list.

    Declaration
    public void Add(Complication comp, int editableId)
    Parameters
    Type Name Description
    Complication comp

    The Complication object.

    int editableId

    The editable id.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the invalid parameter is passed.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    View Source

    Add(DesignElement, int)

    Adds the DesignElement to edit list.

    Declaration
    public void Add(DesignElement de, int editableId)
    Parameters
    Type Name Description
    DesignElement de

    The DesignElement object.

    int editableId

    The editable id.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the invalid parameter is passed.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    View Source

    Dispose()

    Releases all resources used by the EditablesContainer instance.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    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
    bool disposing

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

    View Source

    ~EditablesContainer()

    Destructor of the EditablesContainer class.

    Declaration
    protected ~EditablesContainer()
    View Source

    IsExist(int)

    Checks whether editableId already exists in edit list.

    Declaration
    public bool IsExist(int editableId)
    Parameters
    Type Name Description
    int editableId

    The target editable Id.

    Returns
    Type Description
    bool

    true if the editable already exists in edit list, otherwise false

    View Source

    LoadCurrentData(int)

    Loads the editable's current data.

    Declaration
    public static Bundle LoadCurrentData(int editableId)
    Parameters
    Type Name Description
    int 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
    System.ArgumentException

    Thrown when some parameter are invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    View Source

    OnEditReady(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.

    View Source

    Remove(int)

    Removes the editable from edit list.

    Declaration
    public void Remove(int editableId)
    Parameters
    Type Name Description
    int editableId

    The editable id.

    Examples
    if (myContainer.IsExist(_colorEditId)
        myContainer.Remove(_colorEditId);
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the invalid parameter is passed.

    View Source

    RequestEdit()

    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
    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.

    Implements

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