StopInstance() public static method

public static StopInstance ( AemInstance pInstance ) : void
pInstance AemInstance
return void
 private void ConsoleOutputWindow_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.C && e.Control)
     {
         AemActions.StopInstance(mAemInstance);
     }
 }
Beispiel #2
0
 static void Application_ThreadExit(object sender, EventArgs e)
 {
     // automatically stop instances that are still running on exit
     try {
         if (Program.InstanceList != null)
         {
             foreach (AemInstance instance in Program.InstanceList)
             {
                 Process process = instance.GetInstanceJavaProcess();
                 if (process != null && !process.HasExited)
                 {
                     try {
                         AemActions.StopInstance(instance);
                         instance.NotifyIcon.Visible = false;
                         instance.NotifyIcon.Dispose();
                         instance.NotifyIcon = null;
                     }
                     catch (Exception ex) {
                         mLog.Error("Error stopping instance '" + instance.Name + "'.", ex);
                     }
                 }
             }
         }
     }
     catch (Exception ex) {
         mLog.Error("Error checking for running instances or application shutdown.", ex);
     }
 }