Inheritance: ProcessController
Esempio n. 1
0
 private void btnLaunchPutty_Click(object sender, EventArgs e)
 {
     try
     {
         var puttyProcess = new PuttyProcessController();
         var fileName = chkUseCustomPuttyPath.Checked ? txtCustomPuttyPath.Text : GeneralAppInfo.PuttyPath;
         puttyProcess.Start(fileName);
         puttyProcess.SetControlText("Button", "&Cancel", "&Close");
         puttyProcess.SetControlVisible("Button", "&Open", false);
         puttyProcess.WaitForExit();
     }
     catch (Exception ex)
     {
         MessageBox.Show(Language.strErrorCouldNotLaunchPutty, Application.ProductName,
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
         Runtime.MessageCollector.AddExceptionMessage(Language.strErrorCouldNotLaunchPutty, ex, logOnly: true);
     }
 }
Esempio n. 2
0
 public void SessionSettings()
 {
     try
     {
         var puttyProcess = new PuttyProcessController();
         if (!puttyProcess.Start())
         {
             return ;
         }
         if (puttyProcess.SelectListBoxItem(PuttySession))
         {
             puttyProcess.ClickButton("&Load");
         }
         puttyProcess.SetControlText("Button", "&Cancel", "&Close");
         puttyProcess.SetControlVisible("Button", "&Open", false);
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strErrorCouldNotLaunchPutty + Environment.NewLine + ex.Message);
     }
 }