Ejemplo n.º 1
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns></returns>
        public EnumFieldValue Clone()
        {
            EnumFieldValue newValue = new EnumFieldValue(
                this._elements.Clone(),
                this._type
                );

            newValue._selectedElementIndex = this._selectedElementIndex;
            return(newValue);
        }
Ejemplo n.º 2
0
        public void LoadFromFieldValue(EnumFieldValue value)
        {
            _value = value;

            _radioButtons.Clear();
            flowLayoutPanel1.Controls.Clear();
            //fieldPanel1.Controls.Clear();

            foreach (EnumElementFieldValue v in _value.SubValues.Values)
            {
                RadioButton radioButton = new RadioButton();

                radioButton.Name     = v.MyType.Name;
                radioButton.Text     = v.MyType.DisplayName;
                radioButton.AutoSize = true;

                radioButton.CheckedChanged += new EventHandler(radioButton_CheckedChanged);

                _radioButtons.Add(radioButton.Name, radioButton);
                flowLayoutPanel1.Controls.Add(radioButton);
            }

            _radioButtons[_value.SelectedElement.MyType.Name].Checked = true;
        }
Ejemplo n.º 3
0
        public void LoadFromFieldValue(EnumFieldValue value)
        {
            _value = value;

            _radioButtons.Clear();
            flowLayoutPanel1.Controls.Clear();
            //fieldPanel1.Controls.Clear();

            foreach (EnumElementFieldValue v in _value.SubValues.Values)
            {
                RadioButton radioButton = new RadioButton();

                radioButton.Name = v.MyType.Name;
                radioButton.Text = v.MyType.DisplayName;
                radioButton.AutoSize = true;

                radioButton.CheckedChanged += new EventHandler(radioButton_CheckedChanged);

                _radioButtons.Add(radioButton.Name, radioButton);
                flowLayoutPanel1.Controls.Add(radioButton);
            }

            _radioButtons[_value.SelectedElement.MyType.Name].Checked = true;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns></returns>
        public EnumFieldValue Clone()
        {
            EnumFieldValue newValue = new EnumFieldValue(
                this._elements.Clone(),
                this._type
            );

            newValue._selectedElementIndex = this._selectedElementIndex;
            return newValue;
        }
Ejemplo n.º 5
0
        public void SaveToFieldValue(EnumFieldValue value)
        {
            int index = -1;
            for (int i=0 ; i<_radioButtons.Count ; ++i) {
                if (_radioButtons.Values[i].Checked)
                    index = i;
            }
            fieldPanel1.UpdateResource();

            _value.SelectedElementIndex = index;
            _value.SelectedElement.SubValues = fieldPanel1.SubValues.Clone();
        }