Esempio n. 1
0
 /// <summary>
 /// 字典读取窗体
 /// </summary>
 /// <param name="fm">窗体对象</param>
 /// <returns>是否存在窗体</returns>
 private bool ReadFormDictionary(Form fm)
 {
     if (DicForm.DicFormList.Count() > 0)
     {
         //如果存在窗体
         if (DicForm.DicFormList.ContainsKey(fm))
         {
             //如果为开启状态
             if (DicForm.DicFormList.ContainsValue(true))
             {
                 fm.Activate();
             }
             else
             {
                 fm = new ErrorStartMain_From();
                 fm.Show();
             }
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!ReadFormDictionary(fm))
     {
         fm = new ErrorStartMain_From();
         WriteFormDictionary(fm);
     }
 }