Beispiel #1
0
 public CommonButtons()
 {
     Action_Exit = () =>
     {
         foreach (var form in Application.OpenForms
                  .Cast <Form>()
                  .ToArray())
         {
             form.DialogResult = DialogResult.Cancel;
             form.Close();
         }
         Environment.Exit(0);
     };
     Action_Setting = () => new Forms.SettingForm().ShowDialog();
     Action_Debug   = () => ProgramUtils.StartSelfProcess("-debug", false, false);
 }
Beispiel #2
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     try { ProgramUtils.StartSelfProcess("-start", true)?.WaitForExit(); }
     catch { MessageBox.Show("启动服务失败!"); }
 }