Exemple #1
0
 private async void StartProcess(string proc, string arguements)
 {
     probar.IsIndeterminate = true;
     label.Content          = "游戏正在运行desu...";
     canclose = false;
     DisableAll();
     try
     {
         RunProc runproc = new RunProc {
             ExecutableName = proc, Commandargs = arguements, MPClantag = profile.Clantag, MPTitle = profile.Title
         };
         await runproc.Tick(proc == "iw5mp.exe"? "teknomw3.dll" : "teknomw3_sp.dll");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally
     {
         EnableAll();
         probar.IsIndeterminate = false;
         label.Content          = "准备就绪了呢";
         canclose = true;
     }
 }
Exemple #2
0
 private async void StartProcess(string proc, string arguements)
 {
     Version.Background = new SolidColorBrush(Color.FromRgb(211, 125, 0));
     label.Background   = new SolidColorBrush(Color.FromRgb(255, 125, 0));
     button.Background  = new SolidColorBrush(Color.FromRgb(255, 125, 0));
     button.IsEnabled   = false;
     button.Content     = "已运行";
     button2.IsEnabled  = true;
     try
     {
         RunProc runproc = new RunProc {
             ExecutableName = proc, Commandargs = arguements
         };
         await runproc.Tick(proc == "iw5mp.exe"? "teknomw3.dll" : "teknomw3_sp.dll");
     }
     catch (Exception)
     {
         MessageBox.Show("游戏启动失败!请检查游戏文件是否可用,并且已正确安装联机破解!");
     }
     finally
     {
         Version.Background = new SolidColorBrush(Color.FromRgb(0, 125, 211));
         label.Background   = new SolidColorBrush(Color.FromRgb(0, 125, 255));
         button.Background  = new SolidColorBrush(Color.FromRgb(0, 125, 255));
         button.IsEnabled   = true;
         button.Content     = "启动!";
         button2.IsEnabled  = false;
     }
 }