public VerticalPropagationPlot() { InitializeComponent(); timer = new PrecisionTimer(); timer.Period = 10; timer.Mode = Mode.Periodic; timer.Tick += new EventHandler(timer_Tick); timer.Stopped += (o, e) => { if (this.InvokeRequired) { this.Invoke((MethodInvoker) delegate { SimulationFinishedEvent.Rise(o, e); }); } else { SimulationFinishedEvent.Rise(o, e); } }; timer.Started += (o, e) => { if (this.InvokeRequired) { this.Invoke((MethodInvoker) delegate { SimulationStartedEvent.Rise(o, e); }); } else { SimulationStartedEvent.Rise(o, e); } }; }
private async void UIInfo() { while (!theArgs.CanselationRequest) { Thread.Sleep(theArgs.TickInMilliseconds); SetMainReportTextValues(ReportArgs.MainReportValues); if (ReportArgs.IsTrackingHamster != null) { SetSecondReportTextTypes(ReportArgs.SecondReportTypes); SetSecondReportTextValues(ReportArgs.SecondReportValues); } } if (theArgs.Finished) { await dayCareBackEndAccess.GenerateEndReport(theArgs); Thread.Sleep(100); SimulationFinishedEvent?.Invoke(this, EventArgs.Empty); } }