Ejemplo n.º 1
0
        private static void About_Click(object sender, EventArgs e)
        {
            AboutView aboutView = AboutView.GetInstance();

            aboutView.Focus();
            aboutView.Show();
        }
Ejemplo n.º 2
0
 public static AboutView GetInstance()
 {
     if (AboutViewSingleton == null)         //双重锁定只需要一句判断就可以了
     {
         lock (locker)                       //线程锁
         {
             if (AboutViewSingleton == null) //判断类是否已经实例化
             {
                 AboutViewSingleton = new AboutView();
             }
         }
     }
     return(AboutViewSingleton);
 }
Ejemplo n.º 3
0
 private void AboutView_Closed(object sender, EventArgs e)
 {
     AboutViewSingleton = null;
 }