Beispiel #1
0
        public static ButtonAction AddButton(this ActionCollection actions, string id, string text)
        {
            var action = new ButtonAction(id, text);

            actions.Add(action);
            return(action);
        }
Beispiel #2
0
        public static ButtonAction AddButton(this ActionCollection actions, string id, string text, EventHandler <EventArgs> activated)
        {
            var action = new ButtonAction(id, text, activated);

            actions.Add(action);
            return(action);
        }
Beispiel #3
0
        public static ButtonAction AddButton(this ActionCollection actions, string id, string text, EventHandler <EventArgs> activated, params Key[] accelerators)
        {
            ButtonAction action = new ButtonAction(id, text, activated);

            action.Accelerators = accelerators;
            actions.Add(action);
            return(action);
        }
Beispiel #4
0
        public static bool RemoveCheckHandler(this ActionCollection actions, string actionID, EventHandler <EventArgs> checkChangedHandler)
        {
            var action = actions[actionID] as CheckAction;

            if (action != null)
            {
                action.CheckedChanged -= checkChangedHandler;
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        public static ButtonAction AddButton(this ActionCollection actions, string id, string text, string iconResource, EventHandler <EventArgs> activated)
        {
            Icon icon = null;

            if (!string.IsNullOrEmpty(iconResource))
            {
                icon = Icon.FromResource(Assembly.GetCallingAssembly(), iconResource);
            }
            ButtonAction action = new ButtonAction(id, text, icon, activated);

            actions.Add(action);
            return(action);
        }
Beispiel #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);
        }
Beispiel #7
0
        public static ButtonAction AddButton(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);
            }
            ButtonAction action = new ButtonAction(id, text, icon, activated);

            action.Accelerators = accelerators;
            actions.Add(action);
            return(action);
        }
Beispiel #8
0
        public static ButtonAction AddButton(this ActionCollection actions, string id, string text, string iconResource, EventHandler <EventArgs> activated)
        {
#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 ButtonAction(id, text, icon, activated);
            actions.Add(action);
            return(action);
#endif
        }
Beispiel #9
0
 public static RadioAction AddRadio(this ActionCollection actions, RadioAction controller, string id, string text)
 {
     return(AddRadio(actions, controller, id, text, string.Empty, null, null));
 }
Beispiel #10
0
 public static CheckAction AddCheck(this ActionCollection actions, string id, string text, EventHandler <EventArgs> activated)
 {
     return(AddCheck(actions, id, text, string.Empty, activated, null));
 }
Beispiel #11
0
 public GenerateActionArgs(ActionCollection actions, ActionItemCollection menu, ActionItemCollection toolBar)
 {
     this.actions = actions;
     this.menu    = menu;
     this.toolBar = toolBar;
 }
Beispiel #12
0
 public GenerateActionArgs(Generator g, Control control)
 {
     this.actions = new ActionCollection(g, control);
     this.menu    = new ActionItemCollection(actions);
     this.toolBar = new ActionItemCollection(actions);
 }
Beispiel #13
0
 public ActionItemSubMenu(ActionCollection actions, string subMenuText)
 {
     this.Actions     = new ActionItemCollection(actions);
     this.SubMenuText = subMenuText;
 }
 public ActionItemCollection(ActionCollection actions)
 {
     this.actions = actions;
 }