예제 #1
0
 public ContextMenus(IStatusService statusChangerService, Action <bool> changeIconCallback = null)
 {
     _statusChangerService = statusChangerService;
     _changeIconCallback   = changeIconCallback;
     _toolMenuItemFactory  = new ToolMenuItemFactory(this);
     _statusChangerService.Enable();
 }
예제 #2
0
        private ContextMenuStrip CreateMenu()
        {
            var menu = new ContextMenuStrip();

            var item = _toolMenuItemFactory.CreateEnableItem();

            menu.Items.Add(item);

            item = _toolMenuItemFactory.CreateDisableItem(item);
            menu.Items.Add(item);

            var sep = new ToolStripSeparator();

            menu.Items.Add(sep);

            item = ToolMenuItemFactory.CreateExitButton(item);
            menu.Items.Add(item);

            return(menu);
        }