예제 #1
0
 /// <param name="e"></param>
 /// <summary>
 /// Handles the checked changed event when the value of the check state changes.
 /// </summary>
 protected virtual void OnCheckedChanged(EventArgs e)
 {
     if (CheckedChanged != null)
     {
         CheckedChanged.Invoke(this, e);
     }
 }
예제 #2
0
 protected virtual void OnCheckedChanged(CheckedChangedEventArgs e)
 {
     if (!_nochangeevent)
     {
         CheckedChanged?.Invoke(this, e);
     }
 }
예제 #3
0
파일: Checkbox.cs 프로젝트: Babelz/Fracture
        public void Check(bool isChecked = false)
        {
            if (Group != null)
            {
                foreach (var other in Group)
                {
                    if (ReferenceEquals(this, other))
                    {
                        continue;
                    }

                    other.Checked = false;
                }

                // Group requires one to be checked.
                if (Checked && !isChecked)
                {
                    return;
                }
            }

            var old = Checked;

            Checked = isChecked;

            if (old != Checked)
            {
                CheckedChanged?.Invoke(this, EventArgs.Empty);
            }
        }
예제 #4
0
 /// <summary>
 /// Метод, обрабатывающий событие изменения базового агрегата
 /// </summary>
 /// <param name="e"></param>
 private void OnCheckedChanged(object parent, EventArgs e)
 {
     if (null != CheckedChanged)
     {
         CheckedChanged.Invoke(parent, e);
     }
 }
        private void OnCheckedChanged(object sender, EventArgs <bool> e)
        {
            if (e.Value == false)
            {
                return;
            }

            var selectedItem = sender as CustomRadioButton;

            if (selectedItem == null)
            {
                return;
            }

            foreach (var item in Items)
            {
                if (!selectedItem.Id.Equals(item.Id))
                {
                    item.Checked = false;
                }
                else
                {
                    SelectedIndex = selectedItem.Id;
                    if (CheckedChanged != null)
                    {
                        CheckedChanged.Invoke(sender, item.Id);
                    }
                }
            }
        }
예제 #6
0
        private void CheckHandler(object sender, EventArgs e)
        {
            var currentItem = sender as ToolStripMenuItem;

            CheckItem((T)Enum.Parse(typeof(T), currentItem.Name));
            CheckedChanged?.Invoke();
        }
예제 #7
0
        private void OnCheckedChanged(object sender, EventArgs <bool> e)
        {
            var selectedRad = sender as CustomRadioButton;

            if (e.Value == false)
            {
                if (ItemUnchecked != null && rads.All(x => x.Checked == false))
                {
                    selectedRad.Highlight(false);
                    ItemUnchecked.Invoke(sender, 0);
                }
                return;
            }

            foreach (var rad in rads)
            {
                if (!selectedRad.Id.Equals(rad.Id))
                {
                    rad.Checked = false;
                    rad.Highlight(false);
                }
                else
                {
                    rad.Highlight(true);
                    if (CheckedChanged != null)
                    {
                        CheckedChanged.Invoke(sender, rad.Id);
                    }
                }
            }
        }
예제 #8
0
        private async Task ChangeHandle(ChangeEventArgs e)
        {
            Checked = !Checked;
            await CheckedChanged.InvokeAsync(Checked);

            await OnChanged.InvokeAsync(Checked);
        }
예제 #9
0
        protected async Task InternalOnChange(ChangeEventArgs args)
        {
            if (_indeterminate)
            {
                _indeterminate        = false;
                _indeterminateChanged = true;

                if (!_indeterminateUncontrolled)
                {
                    Indeterminate = false;
                    await IndeterminateChanged.InvokeAsync(false);
                }
            }

            if (!_checkedUncontrolled)
            {
                Checked = (bool)args.Value;
            }
            else
            {
                _isChecked = (bool)args.Value;
            }

            await CheckedChanged.InvokeAsync((bool)args.Value);
        }
예제 #10
0
        private void OnCheckedChanged(object sender, EventArgs <bool> e)
        {
            if (e.Value == false)
            {
                return;
            }

            var selectedRad = sender as CustomRadioButton;

            SelectedIndex = selectedRad.Id;
            foreach (var rad in rads)
            {
                if (!selectedRad.Id.Equals(rad.Id))
                {
                    rad.Checked = false;
                }
                else
                {
                    if (CheckedChanged != null)
                    {
                        CheckedChanged.Invoke(sender, rad.Id);
                    }
                }
            }
        }
예제 #11
0
        protected async Task InternalOnChange(ChangeEventArgs args)
        {
            if (_indeterminate)
            {
                _indeterminate        = false;
                _indeterminateChanged = true;

                if (!_indeterminateUncontrolled)
                {
                    Indeterminate = false;
                    await IndeterminateChanged.InvokeAsync(false);
                }
            }

            bool?value = (bool?)args.Value;

            if (!_checkedUncontrolled)
            {
                Checked = value;
            }
            else
            {
                _isChecked = value.GetValueOrDefault();
            }

            await CheckedChanged.InvokeAsync(value.GetValueOrDefault());

            CascadedEditContext?.NotifyFieldChanged(FieldIdentifier);
        }
예제 #12
0
 /// <summary>
 /// ћетод, обрабатывающий событие изменени¤ базового агрегата
 /// </summary>
 /// <param name="e"></param>
 protected void OnCheckedChanged(EventArgs e)
 {
     if (null != CheckedChanged)
     {
         CheckedChanged.Invoke(this, e);
     }
 }
예제 #13
0
 protected override void OnClick(EventArgs e)
 {
     _Checked = !_Checked;
     CheckedChanged?.Invoke(this);
     Focus();
     Invalidate();
     base.OnClick(e);
 }
예제 #14
0
 protected async Task ToggleCheck()
 {
     if (!Disabled)
     {
         Checked = !Checked;
         await CheckedChanged.InvokeAsync(Checked);
     }
 }
예제 #15
0
 protected void ToggleCheck()
 {
     if (!Disabled)
     {
         Checked = !Checked;
         CheckedChanged?.Invoke(Checked);
     }
 }
예제 #16
0
 void button_MouseButtonClick(Widget source, EventArgs e)
 {
     button.Selected = !button.Selected;
     if (CheckedChanged != null)
     {
         CheckedChanged.Invoke(button, EventArgs.Empty);
     }
 }
예제 #17
0
 public CheckedMenuItem(MenuItem menuItem) : base(menuItem)
 {
     menuItem.Click += (s, e) =>
     {
         menuItem.Checked = !menuItem.Checked;
         CheckedChanged?.Invoke();
     };
 }
예제 #18
0
 private void Initialize(Tuple <IAttributeSet, int> tuple)
 {
     InitializeStyleAttributeProperties(tuple.Item1);
     Click += delegate
     {
         SetState(!isChecked);
         CheckedChanged?.Invoke(this, isChecked);
     };
 }
예제 #19
0
 public SynchToggle()
 {
     InitializeComponent();
     this.metroToggle1.CheckedChanged += (s, e) =>
     {
         observable?.SetValue(PropertyName, metroToggle1.Checked);
         CheckedChanged?.Invoke(this, new EventArgs());
     };
 }
예제 #20
0
        private void ToggleAmDuongText()
        {
            if (this.Enabled && EnableClick)
            {
                FormUtils.ToggleTextAmDuong(this);

                CheckedChanged?.Invoke(null, null);
            }
        }
예제 #21
0
        public ToolStripMenuElement(ToolStripMenuItem menuItem)
            : base(menuItem)
        {
            _menuItem = menuItem;

            menuItem.Click += (s, e) => Execute?.Invoke();
            menuItem.DropDownOpening += (s, e) => Popup?.Invoke();
            menuItem.CheckedChanged += (s, e) => CheckedChanged?.Invoke();
        }
예제 #22
0
        private void chkMain_CheckedChanged(object sender, EventArgs e)
        {
            txtMain.Enabled = chkMain.Checked;

            if (CheckedChanged != null)
            {
                CheckedChanged.Invoke(this, e);
            }
        }
예제 #23
0
        /// <summary>
        /// Raises the <see cref="CheckedChanged"/> event.
        /// </summary>
        /// <param name="e">Event arguments.</param>
        public void OnCheckedChanged(EventArgs e)
        {
            CheckedChanged?.Invoke(this, e);

            if (Command is IValueCommand <bool> valueCommand)
            {
                valueCommand.SetValue(CommandParameter, Checked);
            }
        }
예제 #24
0
        private void OnCheckedChanged(bool?isChecked)
        {
            if ((isChecked.Value && State.HasFlag(ListItemState.Selected)) || (!isChecked.Value && !State.HasFlag(ListItemState.Selected)))
            {
                return;
            }

            CheckedChanged?.Invoke(this, new EventArgs <MenuOptionItemModel>(this));
        }
예제 #25
0
        //
        public methodBase()
        {
            plus = Properties.Resources.icons8_plus_math_32;
            sub  = Properties.Resources.icons8_subtract_32;
            del  = Properties.Resources.icons8_delete_32;

            cbischecked.CheckedChanged += (s, e) => { CheckedChanged?.Invoke(); Refresh(); };
            Controls.Add(cbischecked);
        }
예제 #26
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public CCheckBox()
 {
     this.cbx = new CheckBox {
         Anchor = AnchorStyles.Left | AnchorStyles.Right, Name = "cCheckBox", Text = ""
     };
     this.Container.Controls.Add(this.cbx);
     this.cbx.CheckedChanged += (sender, e) => CheckedChanged?.Invoke(this, e);
     this.PanelBorder         = false;
 }
예제 #27
0
        void OnIsCheckedPropertyChanged(bool isChecked)
        {
            if (isChecked)
            {
                UpdateRadioButtonGroup();
            }

            CheckedChanged?.Invoke(this, new CheckedChangedEventArgs(isChecked));
            ChangeVisualState();
        }
예제 #28
0
        private void Back_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (DisableButton)
            {
                return;
            }

            Toggle();
            CheckedChanged?.Invoke(this, IsChecked);
        }
예제 #29
0
 protected override void OnClick(EventArgs e)
 {
     _checked = !Checked;
     if (CheckedChanged != null)
     {
         CheckedChanged.Invoke(this);
     }
     base.OnClick(e);
     Invalidate();
 }
        /// <summary>
        /// Raises the CheckedChanged event.
        /// </summary>
        /// <param name="e">An EventArgs containing the event data.</param>
        protected virtual void OnCheckedChanged(EventArgs e)
        {
            CheckedChanged?.Invoke(this, e);

            // If there is a command associated then update with new state
            if (KryptonCommand != null)
            {
                KryptonCommand.Checked = Checked;
            }
        }