Пример #1
0
        private void fileExportDataSourceMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;

            try
            {
                TreeNode rootNode = ExportModelHelper.Export(menuItem.Text, this.treeView);
                rootNode.ExpandAll();
                this.treeView.SelectedNode = rootNode;
            }
            catch (Exception ex)
            {
                if (this.treeView.Nodes.Count > 0)
                {
                    this.treeView.Nodes[this.treeView.Nodes.Count - 1].Remove();
                }

                logger.Error(Resources.ExportDataSourceFailure, ex);
                MessageBoxHelper.Display(ex.Message);
                return;
            }

            this.clearCtxMenuItem.Enabled = true;
            this.statusBarReady.Text      = string.Format(Resources.ExportDataSourceFormat, menuItem.Text);
        }
Пример #2
0
        private void fileExportPdmMenuItem_Click(object sender, EventArgs e)
        {
            this.openFileDialog.Title  = Resources.OpenPowerDesignerPDMFile;
            this.openFileDialog.Filter = Resources.PhysicalDataModelFileExt;
            if (this.openFileDialog.ShowDialog() == DialogResult.OK)
            {
                string pdmFileName = this.openFileDialog.FileName;

                try
                {
                    TreeNode rootNode = ExportModelHelper.ExportPDM(pdmFileName, this.treeView);
                    rootNode.ExpandAll();
                    this.treeView.SelectedNode = rootNode;
                }
                catch (Exception ex)
                {
                    if (this.treeView.Nodes.Count > 0)
                    {
                        this.treeView.Nodes[this.treeView.Nodes.Count - 1].Remove();
                    }

                    logger.Error(Resources.ExportPDMFileFailure, ex);
                    MessageBoxHelper.Display(ex.Message);
                    return;
                }

                this.clearCtxMenuItem.Enabled = true;
                this.statusBarReady.Text      = string.Format(Resources.ExportFormat, pdmFileName);
            }
        }
Пример #3
0
 private void treeView_AfterCheck(object sender, TreeViewEventArgs e)
 {
     ExportModelHelper.CheckedTreeNode(e.Node);
 }