Ejemplo n.º 1
0
        private void AddNode(fancyModelMesh.Block Block)
        {
            TreeNode       tNode = new TreeNode();
            ToolWindowBase tBase = null;

            if (Block is fancyModelMesh.VertexBlock)
            {
                tBase = new VertexEditor(tNode, Block);
            }
            else if (Block is fancyModelMesh.IndexBlock)
            {
                tBase = new IndexEditor(tNode, Block);
            }
            else if (Block is fancyModelMesh.SubsetBlock)
            {
                tBase = new SubsetEditor(tNode, Block);
            }
            else if (Block is fancyModelMesh.MaterialBlock)
            {
                tBase = new MaterialEditor(tNode, Block);
            }
            else if (Block is fancyModelMesh.BoundingBoxBlock)
            {
                tBase = new BoundingBoxEditor(tNode, Block);
            }
            else if (Block is fancyModelMesh.UnknownBlock)
            {
                tBase = new UserDataEditor(tNode, Block);
            }

            tNode.Tag = tBase;
            LabelTreeView.Nodes.Add(tNode);
        }
Ejemplo n.º 2
0
 private void treeView_labels_DoubleClick(object sender, EventArgs e)
 {
     if (treeView_labels.SelectedNode != null)
     {
         ToolWindowBase tForm = treeView_labels.SelectedNode.Tag as ToolWindowBase;
         if (tForm != null && !(tForm is VertexEditor) && !(tForm is IndexEditor))
         {
             if (tForm.Visible == false)
             {
                 tForm.Show(DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.Document);
             }
             else
             {
                 tForm.Focus();
             }
         }
     }
 }
Ejemplo n.º 3
0
        private void toolStripButton_remove_Click(object sender, EventArgs e)
        {
            if (treeView_labels.SelectedNode != null && treeView_labels.SelectedNode.Tag is ToolWindowBase)
            {
                TreeNode       p     = treeView_labels.SelectedNode;
                ToolWindowBase tForm = p.Tag as ToolWindowBase;

                if (DialogResult.Yes == MessageBox.Show(
                        String.Format("确认删除数据块 {0} ?\n\n该操作不可逆!", tForm.Block.BlockName),
                        "删除数据块", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                {
                    _File.BlockList.Remove(tForm.Block);

                    if (tForm != null)
                    {
                        tForm.Close();
                    }

                    p.Remove();
                }
            }
        }