/// <summary> /// End process polling interval and finalise logging /// </summary> private void EndProcessListener() { try { //Stop main listener timer ListenerTimer.Stop(); ListenerTimer.Dispose(); //Stop update timer UpdateTimer.Stop(); UpdateTimer.Dispose(); } catch (Exception ex) { Tools.LogError(ex); Errors.Add("Error stopping process listener: " + ex.Message); } try { OnProcessEnd?.Invoke(this, EventArgs.Empty); } catch (Exception ex) { Tools.LogError(ex); Errors.Add("Error running Process End event: " + ex.Message); } }
private void p_Exited(object sender, EventArgs e) { OnProcessEnd?.Invoke(this, EventArgs.Empty); onFinish?.Invoke(param); onFinish = null; }
private async void btnLoginBulk_Click(object sender, EventArgs e) { if (OnProcessBegin != null) { OnProcessBegin.Invoke(sender, e); } CmLoginProxy.Activate(); await LoginBulkAsync(CmLoginProxy); if (OnProcessEnd != null) { OnProcessEnd.Invoke(sender, e); } }
/// <summary> /// Blocks thread until game is over. /// </summary> private void WaitForProcessToEnd() { ServerProcess.WaitForExit(); Active = false; ServerProcess = null; try { OnProcessEnd.Invoke(this, null); } catch { } }