Пример #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);
			}
Пример #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);
 }
Пример #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;
		}
Пример #4
0
        public static void Toggle(object sender, EventArgs args)
        {
            if (!(sender is RadioAction))
            {
                return;
            }
            RadioAction action = (RadioAction)sender;

            action.Checked = true;
        }
Пример #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
		}
Пример #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);
        }
Пример #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);
		}
Пример #8
0
		public RadioAction(RadioAction controller, string id, string text, Icon icon, EventHandler<EventArgs> activated) : base(id, text, icon, activated)
		{
			this.Controller = controller;
		}
Пример #9
0
		public RadioAction(RadioAction controller)
		{
			this.Controller = controller;
		}
Пример #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));
 }
Пример #11
0
 public RadioAction(RadioAction controller, string id, string text, Icon icon, EventHandler <EventArgs> activated) : base(id, text, icon, activated)
 {
     this.Controller = controller;
 }
Пример #12
0
 public RadioAction(RadioAction controller)
 {
     this.Controller = controller;
 }