public NumericUpDownWrapper(NumericUpDown numericUpDown, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent) { _numericUpDown = numericUpDown; _numericUpDown.ValueChanged += numericUpDown_ValueChanged; value?.ReadVisit(this); }
public TrackBarWrapper(TrackBar trackBar, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent) { _trackBar = trackBar; _trackBar.ValueChanged += trackBar_ValueChanged; value?.ReadVisit(this); }
public CheckBoxWrapper(CheckBox checkBox, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent) { _checkBox = checkBox; // register onChange event _checkBox.CheckedChanged += checkBox_CheckedChanged; value?.ReadVisit(this); }
public TextBoxWrapper(TextBox textBox, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent) { _textBox = textBox; // register onChange event _textBox.TextChanged += textBox_TextChanged; value?.ReadVisit(this); }
protected ControlWrapper(string valueName, CManagedPrefPage_v3 parent) { _valueName = valueName; _parent = parent; AssociateValue(); //ConfValuesManager.GetInstance().OnValueChanged += new ConfValuesManager.ValueChangedDelegate(onValueChanged); if (value == null) { ConfValuesManager.GetInstance().OnValueCreated += value_OnCreated; } }
public void CreateWrappers(CManagedPrefPage_v3 instance) { _instance = instance; Type formType = _instance.GetType(); MemberInfo[] controls = formType.FindMembers(MemberTypes.Field, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance, ControlsMemberFilter, null); foreach (MemberInfo m in controls) { FieldInfo f = (FieldInfo)m; Control value = (Control)f.GetValue(_instance); if (value?.Tag == null) { continue; } CreateWrapper(f, value, this._instance); } }
private void CreateWrapper(FieldInfo f, Control value, CManagedPrefPage_v3 parent) { if (f.FieldType == typeof(TextBox)) { _controlWrappers.Add(new TextBoxWrapper((TextBox)value, (string)value.Tag, parent)); } else if (f.FieldType == typeof(TrackBar)) { _controlWrappers.Add(new TrackBarWrapper((TrackBar)value, (string)value.Tag, parent)); } else if (f.FieldType == typeof(CheckBox)) { _controlWrappers.Add(new CheckBoxWrapper((CheckBox)value, (string)value.Tag, parent)); } else if (f.FieldType == typeof(Label)) { _controlWrappers.Add(new LabelWrapper((Label)value, (string)value.Tag, parent)); } else if (f.FieldType == typeof(NumericUpDown)) { _controlWrappers.Add(new NumericUpDownWrapper((NumericUpDown)value, (string)value.Tag, parent)); } }
public LabelWrapper(Label label, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent) { _label = label; value?.ReadVisit(this); }
public RadioGroupWrapper(string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent) { }