Exemple #1
0
        public void bindData(visual visual, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = visual;
            mNode = treeNode;


            // Move data to control data (DATA -> CONTROL DATA)
            //
            refreshComboBoxItems();

            bool found = false;

            for (int i = 0; i < comboBox1.Items.Count; i++)
            {
                if (String.Compare(mData.defaultmodel, (string)comboBox1.Items[i]) == 0)
                {
                    comboBox1.SelectedItem = comboBox1.Items[i];
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                comboBox1.SelectedIndex = -1;
                comboBox1.SelectedItem  = null;
                comboBox1.Text          = null;
            }

            mIsBindingData = false;
        }
Exemple #2
0
        public void updateData()
        {
            if ((mData == null) || (mNode == null))
            {
                return;
            }

            // Move control data to data (CONTROL DATA -> DATA)
            //
            visual afterChanges = new visual();

            afterChanges.defaultmodel = (string)comboBox1.SelectedItem;

            // Add/Execute undo action
            UndoRedoChangeDataAction undoAction = new UndoRedoChangeDataAction(mData, afterChanges);

            mVisualEditorPage.mUndoRedoManager.addUndoRedoActionAndExecute(undoAction);
        }