コード例 #1
0
 private void Event()
 {
     Control.SecondChange += (ss, ee) =>
     {
         SecondChange?.Invoke(this, new TimeUpdateEventArgs());
     };
     Control.DayChange += (ss, ee) =>
     {
         DayChange?.Invoke(this, new TimeUpdateEventArgs());
     };
     Control.HourChange += (ss, ee) =>
     {
         HourChange?.Invoke(this, new TimeUpdateEventArgs());
     };
     Control.MinuteChange += (ss, ee) =>
     {
         MinuteChange?.Invoke(this, new TimeUpdateEventArgs());
     };
     Control.MonthChange += (ss, ee) =>
     {
         MonthChange?.Invoke(this, new TimeUpdateEventArgs());
     };
     Control.YearChange += (ss, ee) =>
     {
         YearChange?.Invoke(this, new TimeUpdateEventArgs());
     };
     Control.MillisecondChange += (ss, ee) =>
     {
         MillisecondChange?.Invoke(ss, ee);
     };
 }
コード例 #2
0
ファイル: Controller.cs プロジェクト: xdaker/clock
        private void Event()
        {
            try
            {
                foreach (var list in timeChange)
                {
                    switch (list)
                    {
                    case TimeChange.Second:
                        SecondChange?.Invoke(this, new TimeUpdateEventArgs());
                        break;

                    case TimeChange.Minute:
                        MinuteChange?.Invoke(this, new TimeUpdateEventArgs());
                        break;

                    case TimeChange.Hour:
                        HourChange?.Invoke(this, new TimeUpdateEventArgs());
                        break;

                    case TimeChange.Day:
                        DayChange?.Invoke(this, new TimeUpdateEventArgs());
                        break;

                    case TimeChange.Month:
                        MonthChange?.Invoke(this, new TimeUpdateEventArgs());
                        break;

                    case TimeChange.Year:
                        YearChange?.Invoke(this, new TimeUpdateEventArgs());
                        break;

                    default: break;
                    }
                }
            }
            catch
            {
            }
        }