Exemplo n.º 1
0
        private void openBtn_Click(object sender, EventArgs e)
        {
            ProNameList proNameList = ProNameList.InstanceObject();

            proNameList.SetInitBtn += new System.Action <object>(InitialInterface_SetBtn);
            proNameList.Focus();
            proNameList.Show();
        }
Exemplo n.º 2
0
 //创建窗体对象的静态方法
 public static ProNameList InstanceObject()
 {
     if (_instance == null)
     {
         _instance = new ProNameList();
     }
     return(_instance);
 }
 /// <summary>
 /// 设置按钮是否可用 ,打开文件前,部分按钮不可用
 /// </summary>
 /// <param name="sender"></param>
 private void InitialInterface_SetBtn(object sender)
 {
     if (sender is ProNameList)
     {
         ProNameList proNameList = (ProNameList)sender;
         if (proNameList.IsOpen)
         {
             MessageBox.Show("成功载入文件,选项已解锁,请继续操作");
             this.preBtn.Enabled                    = true;
             this.preBtn.BackColor                  = SystemColors.ActiveCaption;
             this.nodeBtn.Enabled                   = true;
             this.nodeBtn.BackColor                 = SystemColors.ActiveCaption;
             this.analysisBtn.Enabled               = true;
             this.analysisBtn.BackColor             = SystemColors.ActiveCaption;
             this.printBtn.Enabled                  = true;
             this.printBtn.BackColor                = SystemColors.ActiveCaption;
             this.导出ToolStripMenuItem1.Enabled      = true;
             this.节点划分ToolStripMenuItem1.Enabled    = true;
             this.项目准备ToolStripMenuItem1.Enabled    = true;
             this.hazop分析ToolStripMenuItem1.Enabled = true;
         }
     }
     if (sender is NewProjectInterface)
     {
         NewProjectInterface proNameList = (NewProjectInterface)sender;
         if (proNameList.IsNew)
         {
             this.preBtn.Enabled                    = true;
             this.preBtn.BackColor                  = SystemColors.ActiveCaption;
             this.nodeBtn.Enabled                   = true;
             this.nodeBtn.BackColor                 = SystemColors.ActiveCaption;
             this.analysisBtn.Enabled               = true;
             this.analysisBtn.BackColor             = SystemColors.ActiveCaption;
             this.printBtn.Enabled                  = true;
             this.printBtn.BackColor                = SystemColors.ActiveCaption;
             this.导出ToolStripMenuItem1.Enabled      = true;
             this.节点划分ToolStripMenuItem1.Enabled    = true;
             this.项目准备ToolStripMenuItem1.Enabled    = true;
             this.hazop分析ToolStripMenuItem1.Enabled = true;
         }
     }
 }
Exemplo n.º 4
0
 private void ProNameList_FormClosing(object sender, FormClosingEventArgs e)
 {
     _instance = null;
 }