Exemplo n.º 1
0
        // export contextual menu
        private void exportContextMenuItem_Click(object sender, EventArgs e)
        {
            IDisplayNode selectedNode = LeftTree.SelectedNode as IDisplayNode;

            if (selectedNode != null)
            {
                if (selectedNode.GetType() == "mesh")
                {
                    exportMeshToolStripMenuItem_Click(sender, e);
                }
                else if (selectedNode.GetType() == "morph")
                {
                    exportMorphToolStripMenuItem_Click(sender, e);
                }
            }
        }
Exemplo n.º 2
0
        // on select in the list tree
        private void LeftTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            exportMeshToolStripMenuItem.Enabled         = false;
            exportMorphToolStripMenuItem.Enabled        = false;
            exportAllPccMeshesToolStripMenuItem.Enabled = false;
            exportAllPccMorphsToolStripMenuItem.Enabled = false;
            LeftTreeContextMenuStrip.Visible            = false;
            exportContextMenuItem.Visible = false;

            IDisplayNode nodeToDisplay = LeftTree.SelectedNode as IDisplayNode;

            if (nodeToDisplay != null)
            {
                nodeToDisplay.DisplayDetails(DetailsTreeView);

                switch (nodeToDisplay.GetType())
                {
                case "pcc":
                    exportMeshToolStripMenuItem.Enabled         = false;
                    exportMorphToolStripMenuItem.Enabled        = false;
                    exportAllPccMeshesToolStripMenuItem.Enabled = true;
                    exportAllPccMorphsToolStripMenuItem.Enabled = true;
                    break;

                case "morph":
                    exportMeshToolStripMenuItem.Enabled         = false;
                    exportAllPccMeshesToolStripMenuItem.Enabled = false;
                    exportAllPccMorphsToolStripMenuItem.Enabled = false;
                    if (((MorphTreeNode)nodeToDisplay).morph.IsExportable)
                    {
                        LeftTreeContextMenuStrip.Visible     = true;
                        exportContextMenuItem.Visible        = true;
                        exportContextMenuItem.Enabled        = true;
                        exportMorphToolStripMenuItem.Enabled = true;
                    }
                    break;

                case "mesh":
                    exportMeshToolStripMenuItem.Enabled         = true;
                    exportMorphToolStripMenuItem.Enabled        = false;
                    exportAllPccMeshesToolStripMenuItem.Enabled = false;
                    exportAllPccMorphsToolStripMenuItem.Enabled = false;
                    LeftTreeContextMenuStrip.Visible            = true;
                    exportContextMenuItem.Visible = true;
                    exportContextMenuItem.Enabled = true;
                    break;
                }
            }
        }