Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
 //检查更新
 private void CheckNewVersion_Tick(object sender, EventArgs e)
 {
     try
     {
         _checkUpdate = new CheckUpdate();
         if (_checkUpdate.IsConnectedInternet())
         {
             if (_checkUpdate.Download())
             {
                 if (_checkUpdate.HasNewVersion())
                 {
                     form_Update = UpdateForm.GetInstance(_checkUpdate.NewVersion);
                     form_Update.CloseHandlor += new UpdateForm.CloseHandler(CloseDeskHelper);
                     form_Update.ShowForm();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         log.WriteLog(ex.ToString());
     }
     finally
     {
         updateTimer.Enabled = false;
     }
 }
Exemplo n.º 2
0
 //检查更新
 private void UpdateMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         check = new CheckUpdate();
         if (check.IsConnectedInternet())
         {
             if (check.Download())
             {
                 if (check.HasNewVersion())
                 {
                     updateForm = UpdateForm.GetInstance(check.NewVersion);
                     updateForm.CloseHandlor += new UpdateForm.CloseHandler(CloseDeskHelper);
                     updateForm.ShowForm();
                 }
                 else//HasNewVersion()
                 {
                     MessageBox.Show("已经是最新版本");
                 }
             }
             else//Download()
             {
                 MessageBox.Show("已经是最新版本");
             }
         }
         else//IsConnectedInternet()
         {
             MessageBox.Show("本机没有连接互联网");
         }
     }
     catch
     {
     }
 }
Exemplo n.º 3
0
 //检查更新
 private void UpdateToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         _checkUpdate = new CheckUpdate();
         if (_checkUpdate.IsConnectedInternet())
         {
             if (_checkUpdate.Download())
             {
                 if (_checkUpdate.HasNewVersion())
                 {
                     form_Update = UpdateForm.GetInstance(_checkUpdate.NewVersion);
                     form_Update.CloseHandlor += new UpdateForm.CloseHandler(CloseDeskHelper);
                     form_Update.ShowForm();
                 }
                 else//HasNewVersion()
                 {
                     MessageBox.Show("已经是最新版本");
                 }
             }
             else//Download()
             {
                 MessageBox.Show("已经是最新版本");
             }
         }
         else//IsConnectedInternet()
         {
             MessageBox.Show("本机没有连接互联网");
         }
     }
     catch (Exception ex)
     {
         log.WriteLog(ex.ToString());
     }
 }
Exemplo n.º 4
0
 private void UpdateForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (form != null)
     {
         form.Dispose();
         form = null;
     }
 }
Exemplo n.º 5
0
 public static UpdateForm GetInstance(string version)
 {
     if (form == null)
     {
         lock (synLock)
         {
             if (form == null)
             {
                 form = new UpdateForm(version);
             }
         }
     }
     return(form);
 }
Exemplo n.º 6
0
 //检查更新
 private void CheckNewVersion()
 {
     try
     {
         check = new CheckUpdate();
         if (check.IsConnectedInternet())
         {
             if (check.Download())
             {
                 if (check.HasNewVersion())
                 {
                     updateForm = UpdateForm.GetInstance(check.NewVersion);
                     updateForm.CloseHandlor += new UpdateForm.CloseHandler(CloseDeskHelper);
                     updateForm.ShowForm();
                 }
             }
         }
     }
     catch
     {
     }
 }
Exemplo n.º 7
0
 //检查更新
 private void UpdateMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         check = new CheckUpdate();
         if (check.IsConnectedInternet())
         {
             if (check.Download())
             {
                 if (check.HasNewVersion())
                 {
                     updateForm = UpdateForm.GetInstance(check.NewVersion);
                     updateForm.CloseHandlor += new UpdateForm.CloseHandler(CloseDeskHelper);
                     updateForm.ShowForm();
                 }
                 else//HasNewVersion()
                 {
                     MessageBox.Show("已经是最新版本");
                 }
             }
             else//Download()
             {
                 MessageBox.Show("已经是最新版本");
             }
         }
         else//IsConnectedInternet()
         {
             MessageBox.Show("本机没有连接互联网");
         }
     }
     catch
     {
     }
 }
Exemplo n.º 8
0
 //检查更新
 private void CheckNewVersion()
 {
     try
     {
         check = new CheckUpdate();
         if (check.IsConnectedInternet())
         {
             if (check.Download())
             {
                 if (check.HasNewVersion())
                 {
                     updateForm = UpdateForm.GetInstance(check.NewVersion);
                     updateForm.CloseHandlor += new UpdateForm.CloseHandler(CloseDeskHelper);
                     updateForm.ShowForm();
                 }
             }
         }
     }
     catch
     {
     }
 }