Esempio n. 1
0
			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);
			}
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
		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;
		}
Esempio n. 4
0
        public static void Toggle(object sender, EventArgs args)
        {
            if (!(sender is RadioAction))
            {
                return;
            }
            RadioAction action = (RadioAction)sender;

            action.Checked = true;
        }
Esempio n. 5
0
		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
		}
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
		public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text)
		{
			return AddRadio(actions, controller, id, text, string.Empty, null, null);
		}
Esempio n. 8
0
		public RadioAction(RadioAction controller, string id, string text, Icon icon, EventHandler<EventArgs> activated) : base(id, text, icon, activated)
		{
			this.Controller = controller;
		}
Esempio n. 9
0
		public RadioAction(RadioAction controller)
		{
			this.Controller = controller;
		}
Esempio n. 10
0
 public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text)
 {
     return(AddRadio(actions, controller, id, text, string.Empty, null, null));
 }
Esempio n. 11
0
 public RadioAction(RadioAction controller, string id, string text, Icon icon, EventHandler <EventArgs> activated) : base(id, text, icon, activated)
 {
     this.Controller = controller;
 }
Esempio n. 12
0
 public RadioAction(RadioAction controller)
 {
     this.Controller = controller;
 }