예제 #1
0
 public Tasks()
 {
     InitializeComponent();
     InitToolStrips();
     Instance = this;
     ReminderHandler.Load();
 }
예제 #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine(DateTime.Now.TimeOfDay);
            Console.WriteLine("DSS invoked...##");

            var reminderHandler    = new ReminderHandler();
            var motionHandler      = new MotionEventHandler();
            var fallEventHandler   = new FallDetectionHandler();
            var measurementHandler = new MeasurementHandler();

            var url = "amqp://*****:*****@cami-rabbitmq:5672/cami";

            try
            {
                var rmqEvents = new RmqExchange(url, "events", "event.*", (json) => {
                    reminderHandler.Handle(json);
                    motionHandler.Handle(json);
                    fallEventHandler.Handle(json);
                });
                var rmqMeasurements = new RmqExchange(url, "measurements", "measurement.*", (json) => { measurementHandler.Handle(json); });
            }
            catch (Exception ex)
            {
                Console.WriteLine("Something went wrong with the rmq exchange: " + ex);
            }

            Console.WriteLine("RMQ binding done!");


            while (true)
            {
            }

            Console.WriteLine("Exiting DSS...");
        }
예제 #3
0
 private void TaskList_ItemChecked(object sender, ItemCheckedEventArgs e)
 {
     if (e.Item != null && e.Item.Tag != null && !reloading)
     {
         Reminder r = (Reminder)e.Item.Tag;
         r.Completed = e.Item.Checked;
         ReminderHandler.UpdateReminder(r);
     }
 }
예제 #4
0
 public static void ReloadList()
 {
     reloading = true;
     if (Instance == null || Instance.TaskList == null)
     {
         return;
     }
     Instance.TaskList.Items.Clear();
     ReminderHandler.GenerateList(Instance.TaskList, Setting.Value.Reminder_ShowCompleted);
     reloading = false;
 }
예제 #5
0
        private void IncompleteMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedItem.Tag == null)
            {
                return;
            }
            Reminder r = (Reminder)SelectedItem.Tag;

            r.Completed = false;
            ReminderHandler.UpdateReminder(r);
        }
예제 #6
0
 private void CreateButton_Click(object sender, EventArgs e)
 {
     UpdateReminder();
     if (CreateButton.Text == "Create")
     {
         ReminderHandler.AddReminder(_reminder);
     }
     else
     {
         ReminderHandler.UpdateReminder(_reminder);
     }
     this.Close();
 }
예제 #7
0
 public Reminders(ReminderHandler reminderHandler)
 {
     ReminderHandler = reminderHandler;
 }
예제 #8
0
 private void InitializeHandlers(DiscordSocketClient c)
 {
     _commands = new CommandHandler(c);
     _reminder = new ReminderHandler(c);
     _mention  = new MentionHandler(c);
 }