Exemple #1
0
        protected override void InitField()
        {
            EditorToggle toggle = new EditorToggle();

            toggle.Value          = GetValue <Boolean>();
            toggle.TriggerHandler = (Widget w) =>
            {
                this.SetValue(toggle.Value);
            };
            this.AddField(toggle);
        }
        /// <summary>
        /// 移除控件
        /// </summary>
        /// <param name="toggle"></param>
        public void Remove(EditorToggle toggle)
        {
            if (toggle == null)
            {
                return;
            }

            if (!_toggles.Contains(toggle))
            {
                return;
            }

            _toggles.Remove(toggle);
        }
        /// <summary>
        /// 添加控件
        /// </summary>
        /// <param name="toggle"></param>
        public void Add(EditorToggle toggle)
        {
            if (toggle == null)
            {
                return;
            }

            if (_toggles.Contains(toggle))
            {
                return;
            }

            _toggles.Add(toggle);
        }