public MenuConnector(RadioAction action, RadioMenuItem menuItem) { this.action = action; this.menuItem = menuItem; this.menuItem.Click += menuItem_Click; 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(RadioAction action, RadioMenuItem menuItem) { this.action = action; this.menuItem = menuItem; this.menuItem.Click += menuItem_Click; 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 RadioAction AddRadio(this ActionCollection actions, RadioAction controller, 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); RadioAction action = new RadioAction(controller, id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return action; }
public static void Toggle(object sender, EventArgs args) { if (!(sender is RadioAction)) { return; } RadioAction action = (RadioAction)sender; action.Checked = true; }
public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text, string iconResource, EventHandler<EventArgs> activated, params Keys[] accelerators) { #if WINRT throw new NotImplementedException(); #else Icon icon = null; if (!string.IsNullOrEmpty(iconResource)) icon = Icon.FromResource(Assembly.GetCallingAssembly(), iconResource); var action = new RadioAction(controller, id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return action; #endif }
public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text, string iconResource, EventHandler <EventArgs> activated, params Key[] accelerators) { Icon icon = null; if (!string.IsNullOrEmpty(iconResource)) { icon = Icon.FromResource(Assembly.GetCallingAssembly(), iconResource); } RadioAction action = new RadioAction(controller, id, text, icon, activated); action.Accelerators = accelerators; actions.Add(action); return(action); }
public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text) { return AddRadio(actions, controller, id, text, string.Empty, null, null); }
public RadioAction(RadioAction controller, string id, string text, Icon icon, EventHandler<EventArgs> activated) : base(id, text, icon, activated) { this.Controller = controller; }
public RadioAction(RadioAction controller) { this.Controller = controller; }
public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text) { return(AddRadio(actions, controller, id, text, string.Empty, null, null)); }
public RadioAction(RadioAction controller, string id, string text, Icon icon, EventHandler <EventArgs> activated) : base(id, text, icon, activated) { this.Controller = controller; }