示例#1
0
        private void ToggleFeatureLoad(IToggleFeature toggleFeature)
        {
            this.Menu.Add(this.Name + "enabled", new CheckBox("啟用")).OnValueChange += (sender, args) =>
            {
                if (args.NewValue)
                {
                    toggleFeature.Enable();
                }
                else
                {
                    toggleFeature.Disable();
                }
            };

            if (this[this.Name + "enabled"].Cast <CheckBox>().CurrentValue)
            {
                toggleFeature.Enable();
            }
        }
示例#2
0
        private void ToggleFeatureLoad(IToggleFeature toggleFeature)
        {
            this.Menu.Add(this.Name + "enabled", new CheckBox("Enabled")).OnValueChange += (sender, args) =>
                {
                    if (args.NewValue)
                    {
                        toggleFeature.Enable();
                    }
                    else
                    {
                        toggleFeature.Disable();
                    }
                };

            if (this[this.Name + "enabled"].Cast<CheckBox>().CurrentValue)
            {
                toggleFeature.Enable();
            }
        }