public static CheckBox Listen(this CheckBox src, ControlListenGroup listen) { if (listen != null) { src.CheckedChanged += (s, e) => listen.Trigger(); } return(src); }
public static RadioButton Listen(this RadioButton src, ControlListenGroup listen) { if (listen != null) { src.CheckedChanged += (s, e) => listen.Trigger(); } return(src); }
public static DateTimePicker Listen(this DateTimePicker src, ControlListenGroup listen) { if (listen != null) { src.ValueChanged += (s, e) => listen.Trigger(); } return(src); }
public static TextBox Listen(this TextBox src, ControlListenGroup listen) { if (listen != null) { src.TextChanged += (s, e) => listen.Trigger(); } return(src); }
public static NumericUpDown Listen(this NumericUpDown src, ControlListenGroup listen) { if (listen != null) { src.ValueChanged += (s, e) => listen.Trigger(); } return(src); }
public static ComboBox Listen(this ComboBox src, ControlListenGroup listen, Action action = null) { if (listen != null) { src.SelectionChangeCommitted += (s, e) => listen.Trigger(); } action?.Invoke(); return(src); }
public static DataGridView Listen(this DataGridView src, ControlListenGroup listen) { if (listen != null) { src.RowsAdded += (s, e) => listen.Trigger(); src.RowsRemoved += (s, e) => listen.Trigger(); src.CellValueChanged += (s, e) => listen.Trigger(); } return(src); }
public static DateTimePicker BindValueTo(this DateTimePicker src, Action <DateTime?> action, CheckBox enabled = null, ControlListenGroup clg = null) { void evt() => action(src.GetValue(enabled)); src.ValueChanged += (s, e) => evt(); if (enabled != null) { enabled.CheckedChanged += (e, s) => evt(); } evt(); src.Listen(clg); enabled?.Listen(clg); return(src); }
public static NumericUpDown BindValueTo(this NumericUpDown src, Action <float?> action, RadioButton enabled = null, ControlListenGroup clg = null) { void evt() => action(src.GetValueFloat(enabled)); src.ValueChanged += (e, s) => evt(); if (enabled != null) { enabled.CheckedChanged += (e, s) => evt(); } evt(); src.Listen(clg); enabled?.Listen(clg); return(src); }
public static ComboBox BindValueTo(this ComboBox src, Action <object> action, CheckBox enabled = null, ControlListenGroup clg = null) { void evt() => action(src.GetValue(enabled)); src.SelectionChangeCommitted += (e, s) => evt(); if (enabled != null) { enabled.CheckedChanged += (e, s) => evt(); } evt(); src.Listen(clg); enabled?.Listen(clg); return(src); }
public static RadioButton BindValueTo(this RadioButton src, Action <bool> action, CheckBox enabled = null, ControlListenGroup clg = null) { void evt() => action(src.Checked); src.CheckedChanged += (s, e) => evt(); if (enabled != null) { enabled.CheckedChanged += (e, s) => evt(); } evt(); src.Listen(clg); enabled?.Listen(clg); return(src); }
public static CheckBox BindValueTo(this CheckBox src, Action <bool> action, CheckBox enabled = null, ControlListenGroup clg = null) { src.CheckedChanged += (s, e) => action(src.Checked); action(src.Checked); src.Listen(clg); enabled?.Listen(clg); return(src); }
public static DataGridView BindValueTo(this DataGridView src, Action <DataGridViewRowCollection> action, CheckBox enabled = null, ControlListenGroup clg = null) { void evt() => action(src.Rows); src.RowsAdded += (s, e) => evt(); src.RowsRemoved += (s, e) => evt(); src.CellValueChanged += (s, e) => evt(); if (enabled != null) { enabled.CheckedChanged += (s, e) => evt(); } evt(); src.Listen(clg); enabled?.Listen(clg); return(src); }
public static TextBox BindValueTo(this TextBox src, Action <string> action, CheckBox enabled = null, ControlListenGroup clg = null) { void evt() => action(src.GetValue(enabled)); src.TextChanged += (s, e) => evt(); if (enabled != null) { enabled.CheckedChanged += (e, s) => evt(); } evt(); src.Listen(clg); enabled?.Listen(clg); return(src); }