示例#1
0
 void Context_ShowInterface(object sender, EventArgs e)
 {
     if (interfaceForm == null)
     {
         interfaceForm         = new ServerInterfaceForm(this);
         interfaceForm.Closed += interfaceForm_Closed;
         interfaceForm.Show();
     }
     else
     {
         interfaceForm.Activate();
     }
     //run code on ui thread
     interfaceForm.Invoke((MethodInvoker) delegate {
         interfaceForm.ConsoleOutputTextBox.AppendText(serverProcessOutput);
         interfaceForm.StartServerButton.Enabled = !serverRunning;
         interfaceForm.StopServerButton.Enabled  = serverRunning;
     });
 }
示例#2
0
 void interfaceForm_Closed(object sender, EventArgs e)
 {
     interfaceForm = null;
 }