/// <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); } }
protected virtual void OnCheckedChanged(CheckedChangedEventArgs e) { if (!_nochangeevent) { CheckedChanged?.Invoke(this, e); } }
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); } }
/// <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); } } } }
private void CheckHandler(object sender, EventArgs e) { var currentItem = sender as ToolStripMenuItem; CheckItem((T)Enum.Parse(typeof(T), currentItem.Name)); CheckedChanged?.Invoke(); }
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); } } } }
private async Task ChangeHandle(ChangeEventArgs e) { Checked = !Checked; await CheckedChanged.InvokeAsync(Checked); await OnChanged.InvokeAsync(Checked); }
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); }
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); } } } }
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); }
/// <summary> /// ћетод, обрабатывающий событие изменени¤ базового агрегата /// </summary> /// <param name="e"></param> protected void OnCheckedChanged(EventArgs e) { if (null != CheckedChanged) { CheckedChanged.Invoke(this, e); } }
protected override void OnClick(EventArgs e) { _Checked = !_Checked; CheckedChanged?.Invoke(this); Focus(); Invalidate(); base.OnClick(e); }
protected async Task ToggleCheck() { if (!Disabled) { Checked = !Checked; await CheckedChanged.InvokeAsync(Checked); } }
protected void ToggleCheck() { if (!Disabled) { Checked = !Checked; CheckedChanged?.Invoke(Checked); } }
void button_MouseButtonClick(Widget source, EventArgs e) { button.Selected = !button.Selected; if (CheckedChanged != null) { CheckedChanged.Invoke(button, EventArgs.Empty); } }
public CheckedMenuItem(MenuItem menuItem) : base(menuItem) { menuItem.Click += (s, e) => { menuItem.Checked = !menuItem.Checked; CheckedChanged?.Invoke(); }; }
private void Initialize(Tuple <IAttributeSet, int> tuple) { InitializeStyleAttributeProperties(tuple.Item1); Click += delegate { SetState(!isChecked); CheckedChanged?.Invoke(this, isChecked); }; }
public SynchToggle() { InitializeComponent(); this.metroToggle1.CheckedChanged += (s, e) => { observable?.SetValue(PropertyName, metroToggle1.Checked); CheckedChanged?.Invoke(this, new EventArgs()); }; }
private void ToggleAmDuongText() { if (this.Enabled && EnableClick) { FormUtils.ToggleTextAmDuong(this); CheckedChanged?.Invoke(null, null); } }
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(); }
private void chkMain_CheckedChanged(object sender, EventArgs e) { txtMain.Enabled = chkMain.Checked; if (CheckedChanged != null) { CheckedChanged.Invoke(this, e); } }
/// <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); } }
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)); }
// 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); }
/// <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; }
void OnIsCheckedPropertyChanged(bool isChecked) { if (isChecked) { UpdateRadioButtonGroup(); } CheckedChanged?.Invoke(this, new CheckedChangedEventArgs(isChecked)); ChangeVisualState(); }
private void Back_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (DisableButton) { return; } Toggle(); CheckedChanged?.Invoke(this, IsChecked); }
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; } }