public static async Task MainAsync(string[] commandLineArgs, RunCallback callback = default) { if (!(callback is null)) { await callback(state : null); } }
public RenameController(RunModel runModel, RunCallback runCallback) { this._runModel = runModel; this._runCallback = runCallback; _fileHelper = new FileHelper(); loadListKeywordRemove(); }
public Command(string text, RunCallback run, string usage, string description) { this.Text = text; this.Run = run; this.Usage = usage; this.Description = description; }
/// <summary> /// Internally starts the asynchronous delegate that will drive the Form's message pump on a background thread /// </summary> /// <param name="args">An array of object arguments to be passed to the Run method</param> /// <returns></returns> protected bool Start(object[] args) { try { _windowOk = false; _started = new ManualResetEvent(false); RunCallback callback = new RunCallback(this.Run); IAsyncResult ar = callback.BeginInvoke(args, new AsyncCallback(OnRunEnd), this); if (ar != null) { _started.WaitOne(); return(true); } } catch (Exception ex) { Trace.WriteLine(ex); } return(false); }
public void RunGame(String host, Int16 port) { if (this.pictureBoxTotalBar.InvokeRequired) { RunCallback d = new RunCallback(RunGame); this.Invoke(d, new object[] { host, port }); } else { string AuthServer = host + ":" + port.ToString(); Process TabulaRasa = new Process(); TabulaRasa.StartInfo.FileName = TabulaRasaExe; TabulaRasa.StartInfo.Arguments = TabulaRasaParams + AuthServer; try { TabulaRasa.Start(); } catch (Exception) { MessageBox.Show("Error starting " + TabulaRasaExe, "Wait"); } this.Close(); } }
/// <summary> /// Internally starts the asynchronous delegate that will drive the Form's message pump on a background thread /// </summary> /// <param name="args">An array of object arguments to be passed to the Run method</param> /// <returns></returns> protected bool Start(object[] args) { try { _windowOk = false; _started = new ManualResetEvent(false); RunCallback callback = new RunCallback(this.Run); IAsyncResult ar = callback.BeginInvoke(args, new AsyncCallback(OnRunEnd), this); if (ar != null) { _started.WaitOne(); return true; } } catch(Exception ex) { Trace.WriteLine(ex); } return false; }