示例#1
0
 private void UpdateAlarmTime(object sender, AlarmClockEventArgs e)
 {
     // Is this method on the UI thread? If not then we need to marshal it to the UI thread.
     if (this.InvokeRequired)
     {
         AlarmClock.AlarmDisplayHandler alarmDisplayHandler = new AlarmClock.AlarmDisplayHandler(UpdateAlarmTime);
         Invoke(alarmDisplayHandler, new object[] { sender, e });
     }
     else
     {
         this.textBoxAlarm.Text = e.Message;
     }
 }
示例#2
0
 private void ShowAlarmPicture(object sender, AlarmClockEventArgs e)
 {
     // Is this method on the UI thread? If not then we need to marshal it to the UI thread.
     if (this.InvokeRequired)
     {
         AlarmClock.AlarmDisplayHandler alarmDisplayHandler = new AlarmClock.AlarmDisplayHandler(ShowAlarmPicture);
         Invoke(alarmDisplayHandler, new object[] { sender, e });
     }
     else
     {
         this.pictureBoxAlarm.Show();
         //this.Refresh();
     }
 }
示例#3
0
 private void UpdateTimeOfDay(object sender, AlarmClockEventArgs e)
 {
     // Is this method on the UI thread? If not then we need to marshal it to the UI thread.
     if (this.InvokeRequired)
     {
         AlarmClock.AlarmDisplayHandler alarmDisplayHandler = new AlarmClock.AlarmDisplayHandler(UpdateTimeOfDay);
         Invoke(alarmDisplayHandler, new object[] {sender, e});
     }
     else
     {
         this.textBoxTime.Text = e.Message;
     }
 }
示例#4
0
 private void ShowAlarmPicture(object sender, AlarmClockEventArgs e)
 {
     // Is this method on the UI thread? If not then we need to marshal it to the UI thread.
     if (this.InvokeRequired)
     {
         AlarmClock.AlarmDisplayHandler alarmDisplayHandler = new AlarmClock.AlarmDisplayHandler(ShowAlarmPicture);
         Invoke(alarmDisplayHandler, new object[] {sender, e});
     }
     else
     {
         this.pictureBoxAlarm.Show();
         //this.Refresh();
     }
 }