Example #1
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 /// <returns>Task.</returns>
 public async Task Initialize()
 {
     _timer          = new System.Windows.Forms.Timer();
     _timer.Tick    += Timer_Elapsed;
     _timer.Interval = 90000;
     await RelayBoard.InitializeAsync();
 }
Example #2
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 /// <returns>Task.</returns>
 public async Task Initialize()
 {
     _timer          = new DispatcherTimer();
     _timer.Tick    += Timer_Elapsed;
     _timer.Interval = TimeSpan.FromMilliseconds(90000);
     await RelayBoard.InitializeAsync();
 }
Example #3
0
 public async void Initialize()
 {
     try
     {
         await RelayBoard.InitializeAsync();
     }
     catch (RelayBoardException ex)
     {
         MessageBox.Show(ex.Message, "RelayBoardException", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #4
0
 /// <summary>
 /// Handles the Click event of the ResetRelaysButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private async void ResetRelaysButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         await RelayBoard.InitializeAsync(true);
     }
     catch (RelayBoardException)
     {
         LampToggleButton.IsEnabled = false;
         FanToggleButton.IsEnabled  = false;
         LoadButton.IsEnabled       = false;
     }
 }