Beispiel #1
0
 /// <summary>
 ///   Remove the DDS at position "index" then return this DDS for CommandManager
 /// </summary>
 public TSI.DDS RemoveDDS(int index)
 {
     TSI.DDS removedTSI = tsi.listDDS[index];
     tsi.listDDS.RemoveAt(index);
     GenerateTree();
     return(removedTSI);
 }
Beispiel #2
0
 /// <summary>
 ///   Add DDS called "name" in both TSI and the tree and return the index of this new DDS
 /// </summary>
 public int AddDDS(string name)
 {
     TSI.DDS newDDS = new TSI.DDS();
     newDDS.Path = name;
     tsi.listDDS.Add(newDDS);
     GenerateTree();
     return(TSItree.Nodes.Count - 1);
 }
Beispiel #3
0
        /// <summary>
        ///   Set "dds" at index "DDSIndex"
        /// </summary>
        public void SetDDS(TSI.DDS dds, int DDSIndex)
        {
            tsi.listDDS[DDSIndex]        = dds;
            TSItree.Nodes[DDSIndex].Name = dds.Path;
            TSItree.Nodes[DDSIndex].Text = dds.Path;
            TSItree.Nodes[DDSIndex].Nodes.Clear();

            dds.ListDDS_element.ForEach(delegate(TSI.DDS.DDSElement element)
            {
                DevComponents.AdvTree.Node newElementNode = new DevComponents.AdvTree.Node();
                newElementNode.Name = element.Name;
                newElementNode.Text = element.Name;
                TSItree.Nodes[DDSIndex].Nodes.Add(newElementNode);
            });
        }
        private void addDDSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TSIDockContainer selectTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem;
            OpenFileDialog   DDSdialog = new OpenFileDialog();

            DDSdialog.Filter = "DDS Files (*.dds)|*.dds";
            if (DDSdialog.ShowDialog() == DialogResult.OK)
            {
                TSI.DDS newDDS = new TSI.DDS();
                newDDS.ColourKey = 0;
                newDDS.Path      = System.IO.Path.GetFileName(DDSdialog.FileName);
                selectTSIDockContainer.tsi.listDDS.Add(newDDS);
                DevComponents.AdvTree.Node newDDSNode = new DevComponents.AdvTree.Node();
                newDDSNode.Name = System.IO.Path.GetFileName(DDSdialog.FileName);
                newDDSNode.Text = System.IO.Path.GetFileName(DDSdialog.FileName);
                TreeTSI.Nodes.Add(newDDSNode);
            }
        }
 private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
 {
     if (propertyGrid.SelectedObject.GetType() == typeof(TSI.DDS))
     {
         DevComponents.AdvTree.Node selectNode = TreeTSI.SelectedNode;
         TSI.DDS selectDDS = (TSI.DDS)propertyGrid.SelectedObject;
         selectNode.Name = selectDDS.Path;
         selectNode.Text = selectDDS.Path;
     }
     else if (propertyGrid.SelectedObject.GetType() == typeof(TSI.DDS.DDSElement))
     {
         DevComponents.AdvTree.Node selectNode       = TreeTSI.SelectedNode;
         TSI.DDS.DDSElement         selectDDSElement = (TSI.DDS.DDSElement)propertyGrid.SelectedObject;
         selectNode.Name = selectDDSElement.Name;
         selectNode.Text = selectDDSElement.Name;
         TSIDockContainer selectTSIDockContainer = (TSIDockContainer)MainBar.SelectedDockContainerItem;
         selectTSIDockContainer.DrawAera(TreeTSI.SelectedNode.Parent.Index, TreeTSI.SelectedNode.Index);
     }
 }
 public void Do()
 {
     oldDDS = ((TSIDockContainer)Control).GetDDS(DDSIndex);
     ((TSIDockContainer)Control).SetDDS(newDDS, DDSIndex);
 }
Beispiel #7
0
 /// <summary>
 ///   Add a specified DDS in both TSI and the tree and return the index of this new DDS
 /// </summary>
 /// <param name="dds">a specified dds</param>
 public int AddDDS(TSI.DDS dds, int index)
 {
     tsi.listDDS.Insert(index, dds);
     GenerateTree();
     return(TSItree.Nodes.Count - 1);
 }
 public void Do()
 {
     oldDDS = ((TSIDockContainer)Control).RemoveDDS(DDSIndex);
 }