コード例 #1
0
ファイル: WorkerTest6.cs プロジェクト: rsobon/DelegatesEvents
        public void DoWork()
        {
            var hours = 8;

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

            ReportCompletedEvent?.Invoke(this, EventArgs.Empty);
        }
コード例 #2
0
ファイル: WorkerTest7.cs プロジェクト: rsobon/DelegatesEvents
        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);
        }
コード例 #3
0
 private void OnWorkCompleted()
 {
     ReportCompletedEvent?.Invoke(this, EventArgs.Empty);
 }