示例#1
0
        private void menuItemBrowserModel_Click(object sender, EventArgs e)
        {
            PdmModelViewer viewer = null;

            foreach (IDockContent content in DockPanel.Documents)
            {
                if (content is PdmModelViewer)
                {
                    viewer = content as PdmModelViewer;
                }
            }

            if (viewer == null)
            {
                viewer = new PdmModelViewer();
            }

            TreeNode node = tv.SelectedNode;

            if (node.Tag.GetType().Name == typeof(PDModel).Name)
            {
                PDModel m = node.Tag as PDModel;
                viewer.LoadModel(m);
            }
            if (node.Tag.GetType().Name == typeof(PDPackage).Name)
            {
                PDPackage p = node.Tag as PDPackage;
                viewer.LoadPackage(p);
            }

            viewer.Show(this.DockPanel);
        }
示例#2
0
        private void menuItemBrowserModel_Click(object sender, EventArgs e)
        {
            PdmModelViewer viewer = null;
            foreach (IDockContent content in DockPanel.Documents)
            {
                if (content is PdmModelViewer) viewer = content as PdmModelViewer;
            }

            if (viewer == null) viewer = new PdmModelViewer();

            TreeNode node = tv.SelectedNode;

            if (node.Tag.GetType().Name == typeof(PDModel).Name)
            {
                PDModel m = node.Tag as PDModel;
                viewer.LoadModel(m);
            }
            if (node.Tag.GetType().Name == typeof(PDPackage).Name)
            {
                PDPackage p = node.Tag as PDPackage;
                viewer.LoadPackage(p);
            }

            viewer.Show(this.DockPanel);
        }