public void HandleSwitchEvent(SwitchEvent switchEvent)
        {
            // TODO: how to update the ui when this event happens?
            var index = switchEvents.IndexOf(switchEvent);
            if (index != -1)
            {
                switchEvents[index] = switchEvent;
            }
            else
            {
                switchEvents.Add(switchEvent);
            }

            SetNotifyIconToolTip(); // udpdates the tooltip counts
        }
 private ToolStripMenuItem CreateSubMenu(SwitchEvent switchEvent)
 {
     var menuItem = new ToolStripMenuItem(switchEvent.Name)
     {
         Image = switchEvent.Status ? Resources.SquareGreenButton : Resources.SquareRedButton,
         // TODO : translate in resource file
         ToolTipText = switchEvent.Status ? "ON" : "OFF"
     };
     menuItem.DropDownItems.Add(CreateToolStripMenuItem(switchEvent));
     return menuItem;
 }
        private ToolStripMenuItem CreateToolStripMenuItem(SwitchEvent switchEvent)
        {
            var item = new ToolStripMenuItem(switchEvent.EventDate.ToLocalTime().ToLongTimeString())
            {
                ToolTipText = switchEvent.EventDate.ToLocalTime().ToLongTimeString()
            };

            return item;
        }
 protected bool Equals(SwitchEvent other)
 {
     return string.Equals(Id, other.Id, StringComparison.OrdinalIgnoreCase);
 }