コード例 #1
0
ファイル: frmOptions.cs プロジェクト: hmaster20/mRemoteNC
        private void btnTestProxy_Click(System.Object sender, System.EventArgs e)
        {
            SaveOptions();
            var ud = new mRemoteNC.App.UpdateManager();

            if (ud.IsProxyOK())
            {
                Interaction.MsgBox(Language.strProxyTestSucceeded, MsgBoxStyle.Information, null);
            }
            else
            {
                Interaction.MsgBox(Language.strProxyTestFailed, MsgBoxStyle.Exclamation, null);
            }
        }
コード例 #2
0
 public void CheckForUpdate()
 {
     try
     {
         SetCurrentVersionText(Application.ProductVersion);
         SetUpdateButtonState(false);
         if (IsUpdateCheckHandlerDeclared == false)
         {
             UpdateCheckCompleted += UpdateCheckComplete;
             IsUpdateCheckHandlerDeclared = true;
         }
         ThreadPool.QueueUserWorkItem(state =>
                                          {
                                              try
                                              {
                                                  uD = new App.UpdateManager();
                                                  if (UpdateCheckCompletedEvent != null)
                                                      UpdateCheckCompletedEvent(uD.IsUpdateAvailable());
                                              }
                                              catch (Exception ex)
                                              {
                                                  Runtime.MessageCollector.AddMessage(
                                                      Messages.MessageClass.ErrorMsg,
                                                      Language.strUpdateCheckFailed + Constants.vbNewLine +
                                                      ex.Message, true);
                                              }
                                              finally
                                              {
                                                  SetUpdateButtonState(true);
                                              }
                                          });
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                             Language.strUpdateCheckFailed + Constants.vbNewLine +
                                             ex.Message, true);
     }
 }