Пример #1
0
        private void EditableUpdatedCallback(IntPtr handle, int selectedIdx,
                                             int state, IntPtr userData)
        {
            int editableId;
            ComplicationError err = Interop.WatchfaceComplication.GetEditableId(handle, out editableId);

            if (err != ComplicationError.None)
            {
                ErrorFactory.ThrowException(err, "fail to get current index");
            }

            int currentIdx;

            err = Interop.WatchfaceComplication.GetCurrentIdx(handle, out currentIdx);
            if (err != ComplicationError.None)
            {
                ErrorFactory.ThrowException(err, "fail to get current index");
            }

            DesignElement de = GetDesignElement(editableId);

            if (de != null)
            {
                de.SetCurrentDataIndex(currentIdx);
                de.NotifyUpdate(currentIdx, (State)state);
            }
        }
Пример #2
0
        /// <summary>
        /// Adds the DesignElement to edit list.
        /// </summary>
        /// <param name="de">The DesignElement object.</param>
        /// <param name="editableId">The editable id.</param>
        /// <exception cref="ArgumentException">Thrown when the invalid parameter is passed.</exception>
        /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
        /// <since_tizen> 6 </since_tizen>
        public void Add(DesignElement de, int editableId)
        {
            if (de == null)
            {
                ErrorFactory.ThrowException(ComplicationError.InvalidParam);
            }
            if (IsExist(editableId))
            {
                ErrorFactory.ThrowException(ComplicationError.ExistID);
            }

            IEditable e = de;

            e.EditableId = editableId;
            _deList.Add(de);
        }