public void WorkCallout(object state) { OnWorkDoneEventArgs args = new OnWorkDoneEventArgs(); args.Time = (int)state; OnFinishedWork?.Invoke(this, args); }
/// <summary> /// This method simulates work. /// </summary> public void Work() { Random rnd = new Random(); Console.WriteLine($"Doing work... Thread: {Thread.CurrentThread.ManagedThreadId}"); int intensity = 5000 + rnd.Next(1000, 9000); Thread.Sleep(intensity); OnWorkDoneEventArgs args = new OnWorkDoneEventArgs(); args.Time = intensity; OnFinishedWork?.Invoke(this, args); }