public MenuConnector(CheckAction action, CheckMenuItem menuItem) { this.action = action; this.menuItem = menuItem; this.menuItem.Click += menuItem_Clicked; this.action.EnabledChanged += new EventHandler<EventArgs>(action_EnabledChanged).MakeWeak(e => this.action.EnabledChanged -= e); this.action.CheckedChanged += new EventHandler<EventArgs>(action_CheckedChanged).MakeWeak(e => this.action.CheckedChanged -= e); }
public ToolBarConnector(CheckAction action, CheckToolItem toolBarButton) { this.toolBarButton = toolBarButton; this.toolBarButton.Click += toolBarButton_Click; this.action = action; this.action.EnabledChanged += new EventHandler <EventArgs>(action_EnabledChanged).MakeWeak(e => this.action.EnabledChanged -= e); this.action.CheckedChanged += new EventHandler <EventArgs>(action_CheckedChanged).MakeWeak(e => this.action.CheckedChanged -= e); }
public MenuConnector(CheckAction action, CheckMenuItem menuItem) { this.action = action; this.menuItem = menuItem; this.menuItem.Click += menuItem_Clicked; this.action.EnabledChanged += new EventHandler <EventArgs>(action_EnabledChanged).MakeWeak(e => this.action.EnabledChanged -= e); this.action.CheckedChanged += new EventHandler <EventArgs>(action_CheckedChanged).MakeWeak(e => this.action.CheckedChanged -= e); }
public static CheckAction AddCheck(this ActionCollection actions, string id, string text, string iconResource, EventHandler<EventArgs> activated, params Key[] accelerators) { Icon icon = null; if (iconResource != string.Empty) icon = Icon.FromResource (Assembly.GetCallingAssembly (), iconResource); CheckAction action = new CheckAction(id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return action; }
public static void Toggle(object sender, EventArgs args) { if (!(sender is CheckAction)) { return; } CheckAction action = (CheckAction)sender; action.Checked = !action.Checked; }
public static bool RemoveCheckHandler(this ActionCollection actions, string actionID, EventHandler <EventArgs> checkChangedHandler) { CheckAction action = actions[actionID] as CheckAction; if (action != null) { action.CheckedChanged -= checkChangedHandler; return(true); } return(false); }
public static CheckAction AddCheck(this ActionCollection actions, string id, string text, string iconResource, EventHandler<EventArgs> activated, params Keys[] accelerators) { #if WINRT throw new NotImplementedException("WinRT does not support Assembly.GetCallingAssembly"); #else Icon icon = null; if (!string.IsNullOrEmpty(iconResource)) icon = Icon.FromResource (Assembly.GetCallingAssembly (), iconResource); var action = new CheckAction(id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return action; #endif }
public static CheckAction AddCheck(this ActionCollection actions, string id, string text, string iconResource, EventHandler <EventArgs> activated, params Key[] accelerators) { Icon icon = null; if (iconResource != string.Empty) { icon = Icon.FromResource(Assembly.GetCallingAssembly(), iconResource); } CheckAction action = new CheckAction(id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return(action); }
public static CheckAction AddCheck(this ActionCollection actions, string id, string text, string iconResource, EventHandler <EventArgs> activated, params Keys[] accelerators) { #if WINRT throw new NotImplementedException("WinRT does not support Assembly.GetCallingAssembly"); #else Icon icon = null; if (!string.IsNullOrEmpty(iconResource)) { icon = Icon.FromResource(Assembly.GetCallingAssembly(), iconResource); } var action = new CheckAction(id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return(action); #endif }
public ToolBarConnector(CheckAction action, CheckToolItem toolBarButton) { this.toolBarButton = toolBarButton; this.toolBarButton.Click += toolBarButton_Click; this.action = action; this.action.EnabledChanged += new EventHandler<EventArgs>(action_EnabledChanged).MakeWeak(e => this.action.EnabledChanged -= e); this.action.CheckedChanged += new EventHandler<EventArgs>(action_CheckedChanged).MakeWeak(e => this.action.CheckedChanged -= e); }