private void pasteTreeTSIMenuItem_Click(object sender, EventArgs e) { DevComponents.AdvTree.Node selectedNode = TreeTSI.SelectedNode; TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; if (selectedNode.Level == 1) { if (copiedSprite != null) { int DDSIndex = selectedNode.Parent.Index; int elementIndex = selectedNode.Index; CmdPasteElement cmd = new CmdPasteElement(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = DDSIndex; cmd.elementIndex = elementIndex; cmd.newElement = copiedSprite; selectedTSIDockContainer.getManager().executeCommand(cmd); } } else if (selectedNode.Level == 0) { if (copiedDDS != null) { int DDSIndex = selectedNode.Index; CmdPasteDDS cmd = new CmdPasteDDS(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = DDSIndex; cmd.newDDS = copiedDDS; selectedTSIDockContainer.getManager().executeCommand(cmd); } } }
private void addElementToolStripMenuItem_Click(object sender, EventArgs e) { DevComponents.AdvTree.Node selectedNode = TreeTSI.SelectedNode; TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; if (selectedNode.Level == 1) { int DDSIndex = selectedNode.Parent.Index; int elementIndex = selectedNode.Index; CmdAddElement cmd = new CmdAddElement(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = DDSIndex; cmd.elementIndex = elementIndex + 1; cmd.elementName = "New Element"; selectedTSIDockContainer.getManager().executeCommand(cmd); } else if (selectedNode.Level == 0) { int DDSIndex = selectedNode.Index; CmdAddElement cmd = new CmdAddElement(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = DDSIndex; cmd.elementIndex = selectedNode.Nodes.Count;// add element at the last position cmd.elementName = "New Element"; selectedTSIDockContainer.getManager().executeCommand(cmd); } }
private void removeDDSToolStripMenuItem_Click(object sender, EventArgs e) { DevComponents.AdvTree.Node selectNode = TreeTSI.SelectedNode; TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; if (selectNode.Level == 0) { CmdRemoveDDS cmd = new CmdRemoveDDS(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = selectNode.Index; selectedTSIDockContainer.getManager().executeCommand(cmd); } }
private void addDDSToolStripMenuItem_Click(object sender, EventArgs e) { TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; OpenFileDialog DDSdialog = new OpenFileDialog(); DDSdialog.Filter = "DDS Files (*.dds)|*.dds"; if (DDSdialog.ShowDialog() == DialogResult.OK) { CmdAddDDS cmd = new CmdAddDDS(); cmd.Control = selectedTSIDockContainer; cmd.DDSname = System.IO.Path.GetFileName(DDSdialog.FileName); selectedTSIDockContainer.getManager().executeCommand(cmd); } }
private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { if (propertyGrid.SelectedObject.GetType() == typeof(TSI.DDS)) { TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; DevComponents.AdvTree.Node selectedNode = TreeTSI.SelectedNode; CmdDDSChanged cmd = new CmdDDSChanged(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = selectedNode.Parent.Index; cmd.oldDDS = (TSI.DDS)oldSelectedObject; selectedTSIDockContainer.getManager().executeCommand(cmd); } else if (propertyGrid.SelectedObject.GetType() == typeof(TSI.DDS.DDSElement)) { TSIDockContainer selectedTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem; DevComponents.AdvTree.Node selectedNode = TreeTSI.SelectedNode; CmdElementChanged cmd = new CmdElementChanged(); cmd.Control = selectedTSIDockContainer; cmd.DDSIndex = selectedNode.Parent.Index; cmd.elementIndex = selectedNode.Index; cmd.oldElement = (TSI.DDS.DDSElement)oldSelectedObject; selectedTSIDockContainer.getManager().executeCommand(cmd); } }