Ejemplo n.º 1
0
        public NodeForm(NodeData data, NodeAssignDelegate assign)
        {
            this.assign = assign;

            InitializeComponent();

            if (data != null)
            {
                this.textBoxName.Text = data.Key;

                switch (data.Value.Type)
                {
                case ValueContent.Boolean:
                    this.radioButtonValueBoolean.Checked = true;
                    this.checkBoxValueBoolean.Checked    = data.Value.AsBoolean;

                    break;

                case ValueContent.Map:
                    this.radioButtonValueMap.Checked = true;

                    break;

                case ValueContent.Number:
                    this.radioButtonValueNumber.Checked = true;
                    this.textBoxValueNumber.Text        = data.Value.AsNumber.ToString(CultureInfo.InvariantCulture);

                    break;

                case ValueContent.String:
                    this.radioButtonValueString.Checked = true;
                    this.textBoxValueString.Text        = data.Value.AsString;

                    break;

                default:
                    this.radioButtonValueUndefined.Checked = true;

                    break;
                }
            }

            this.ApplyType();
        }
Ejemplo n.º 2
0
        public NodeForm(NodeData data, NodeAssignDelegate getNode)
        {
            InitializeComponent ();

            this.assign = getNode;

            if (data != null)
            {
                this.textBoxName.Text = data.Key;

                switch (data.Value.Type)
                {
                    case ValueContent.Array:
                        this.radioButtonValueArray.Checked = true;

                        break;

                    case ValueContent.Boolean:
                        this.radioButtonValueBoolean.Checked = true;
                        this.checkBoxValueBoolean.Checked = data.Value.AsBoolean;

                        break;

                    case ValueContent.Number:
                        this.radioButtonValueNumber.Checked = true;
                        this.textBoxValueNumber.Text = data.Value.AsNumber.ToString (CultureInfo.InvariantCulture);

                        break;

                    case ValueContent.String:
                        this.radioButtonValueString.Checked = true;
                        this.textBoxValueString.Text = data.Value.AsString;

                        break;

                    default:
                        this.radioButtonValueUndefined.Checked = true;

                        break;
                }
            }

            this.ApplyType ();
        }