Beispiel #1
0
        static void Main()
        {
            Console.WriteLine("------------------------------------");
            Console.WriteLine("CHECKING BERG LAKE FOR AVAILABILITY\n");

            var logger = new FileLogger();

            using var poller = new ReservationPoller();

            try
            {
                var isAvailable = poller.IsReservationAvailable(XPath.BergLake);

                if (isAvailable)
                {
                    Console.WriteLine("\nReservations ARE available currently");
                    logger.Logger.Information("Reservations are available");

                    var notifier = new EmailNotifier();
                    logger.Logger.Information("Notification email sent");

                    notifier.Notify();
                }
                else
                {
                    Console.WriteLine("\nReservations ARE NOT available currently");
                    logger.Logger.Information("Reservations are not available");
                }
            }
            catch (Exception e)
            {
                logger.Logger.Error($"Error encountered:\n{e}");
                throw;
            }
        }
        private void VideoDataChanged()
        {
            var title       = GetTitle();
            var description = GetDescription();
            var fileName    = GetFileName();

            _emailNotifier.Notify(title, description, fileName);
            _phoneNotifier.Notify(title, description, fileName);
            _youtubeNotifier.Notify(title, description, fileName);
        }
 /// <summary>
 /// Shows the email notifier.
 /// </summary>
 /// <param name="message">The message.</param>
 public void ShowEmailNotifier(EventInvite message)
 {
     System.Windows.Application.Current.Dispatcher.Invoke((Action)(delegate
     {
         try
         {
             _taskbarNotifier.PlayTone();
             _taskbarNotifier.BindInfo(message);
             _taskbarNotifier.SetInitialLocations(false);
             _taskbarNotifier.Notify(0, false);
             EmailDataContext.GetInstance().isNotifyShowing = true;
         }
         catch (Exception ex)
         {
             logger.Error("Error occurred as " + ex.Message);
         }
     }));
 }