Пример #1
0
        public void DoWork()
        {
            var hours = 8;

            for (int i = 0; i <= hours; i++)
            {
                var eventArgs = new ReportHoursEventArgs
                {
                    Hours      = i,
                    ActionType = ActionType.Working,
                    Location   = new Location("KMW", "Warsaw")
                };
                ReportEvent?.Invoke(this, eventArgs);
                Thread.Sleep(500);
            }

            ReportCompletedEvent?.Invoke(this, EventArgs.Empty);
        }
Пример #2
0
 private static void ReportHoursHandler(object sender, ReportHoursEventArgs e)
 {
     Console.WriteLine($"Hours: {e.Hours}, Action Type: {e.ActionType}, at Location: {e.Location.Name}");
 }