Ejemplo n.º 1
0
        public NumericUpDownWrapper(NumericUpDown numericUpDown, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent)
        {
            _numericUpDown = numericUpDown;
            _numericUpDown.ValueChanged += numericUpDown_ValueChanged;

            value?.ReadVisit(this);
        }
Ejemplo n.º 2
0
        public TrackBarWrapper(TrackBar trackBar, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent)
        {
            _trackBar = trackBar;
            _trackBar.ValueChanged += trackBar_ValueChanged;

            value?.ReadVisit(this);
        }
Ejemplo n.º 3
0
        public CheckBoxWrapper(CheckBox checkBox, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent)
        {
            _checkBox = checkBox;

            // register onChange event
            _checkBox.CheckedChanged += checkBox_CheckedChanged;

            value?.ReadVisit(this);
        }
Ejemplo n.º 4
0
        public TextBoxWrapper(TextBox textBox, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent)
        {
            _textBox = textBox;

            // register onChange event
            _textBox.TextChanged += textBox_TextChanged;

            value?.ReadVisit(this);
        }
Ejemplo n.º 5
0
        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;
            }
        }
Ejemplo n.º 6
0
        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);
            }
        }
Ejemplo n.º 7
0
 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));
     }
 }
Ejemplo n.º 8
0
        public LabelWrapper(Label label, string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent)
        {
            _label = label;

            value?.ReadVisit(this);
        }
Ejemplo n.º 9
0
 public RadioGroupWrapper(string valueName, CManagedPrefPage_v3 parent) : base(valueName, parent)
 {
 }