public void updateData() { if ((mData == null) || (mNode == null)) { return; } // Move control data to data (CONTROL DATA -> DATA) // visualModelComponentOrAnimAttach afterChanges = new visualModelComponentOrAnimAttach(); afterChanges.type = visualModelComponentOrAnimAttach.AttachType.ModelFile; afterChanges.name = modelFileBrowseControl.FileName; afterChanges.tobone = (string)toBoneComboBox.SelectedItem; afterChanges.frombone = (string)fromBoneComboBox.SelectedItem; afterChanges.disregardorient = disregardBoneOrientationCheckBox.Checked; // Load asset afterChanges.loadAsset(); // Add/Execute undo action UndoRedoChangeDataAction undoAction = new UndoRedoChangeDataAction(mData, afterChanges); mVisualEditorPage.mUndoRedoManager.addUndoRedoActionAndExecute(undoAction); }
public void bindData(visualModelComponentOrAnimAttach attach, TreeNode treeNode) { mIsBindingData = true; mData = attach; mNode = treeNode; // Move data to control data (DATA -> CONTROL DATA) // refreshComboBoxItems(); modelFileBrowseControl.FileName = mData.name; disregardBoneOrientationCheckBox.Checked = mData.disregardorient; bool found = false; for (int i = 0; i < toBoneComboBox.Items.Count; i++) { if (String.Compare(mData.tobone, (string)toBoneComboBox.Items[i], true) == 0) { toBoneComboBox.SelectedIndex = i; found = true; break; } } if (!found) { toBoneComboBox.SelectedIndex = -1; toBoneComboBox.SelectedItem = null; toBoneComboBox.Text = null; } bool found2 = false; for (int i = 0; i < fromBoneComboBox.Items.Count; i++) { if (String.Compare(mData.frombone, (string)fromBoneComboBox.Items[i], true) == 0) { fromBoneComboBox.SelectedIndex = i; found2 = true; break; } } if (!found2) { fromBoneComboBox.SelectedIndex = -1; fromBoneComboBox.SelectedItem = null; fromBoneComboBox.Text = null; } mIsBindingData = false; }