Esempio n. 1
0
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            EventPointer ep = new EventPointer();

            ep.SetEventInfo(_val);
            ep.Owner = Owner;
            return(pane.AssignActions(ep, pane.FindForm()));
        }
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            DlgSelectEvent dlg = new DlgSelectEvent();

            dlg.LoadData(_menuData);
            DialogResult ret = dlg.ShowDialog(pane.FindForm());

            if (dlg.FrequentlyUsedMethodsChanged)
            {
                _menuData.RemoveMenuCollection();
                pane.Loader.DesignPane.ResetContextMenu();
            }
            if (ret == DialogResult.OK)
            {
                IEvent ei = dlg.ReturnEventInfo;
                if (ei != null)
                {
                    EventPointer ep = ei as EventPointer;
                    if (ep != null)
                    {
                        return(pane.AssignActions(ep, pane.FindForm()));
                    }
                    else
                    {
                        EventClass ec = ei as EventClass;
                        if (ec != null)
                        {
                            EventClass ec2 = (EventClass)ec.Clone();
                            ec2.SetHolder(holder);
                            CustomEventPointer cep = new CustomEventPointer(ec2, this.Owner);
                            return(pane.AssignActions(cep, pane.FindForm()));
                        }
                    }
                }
            }
            return(false);
        }
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            ClassPointer cp  = project.GetTypedData <ClassPointer>(pane.Loader.ClassID);
            ActionClass  act = new ActionClass(cp);           //holder.Host);

            act.ActionMethod = _method.CreatePointer(holder);
            act.ActionName   = act.ActionMethod.DefaultActionName;          //.ReferenceName;
            act.ActionHolder = actsHolder;
            ClassPointer owner = holder.Host as ClassPointer;

            if (owner == null)
            {
                owner = Owner.Host as ClassPointer;
                if (owner == null)
                {
                    owner = _pointer;
                }
            }
            return(owner.CreateNewAction(act, pane.Loader.Writer, scopeMethod, pane.FindForm()));
        }
Esempio n. 4
0
 public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
 {
     return(MenuItemDataPropertySelector.createAction(holder, _property, pane.Loader.Writer, node, scopeMethod, actsHolder, pane.FindForm()) != null);
 }
Esempio n. 5
0
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            CustomEventPointer ep = new CustomEventPointer(_event, holder);

            return(pane.AssignActions(ep, pane.FindForm()));
        }
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            PropertyPointer pp = new PropertyPointer();

            pp.SetPropertyInfo(_val);
            pp.Owner = Owner;
            return(DesignUtil.CreateSetPropertyAction(pp, pane.Loader.DesignPane, scopeMethod, actsHolder, pane.FindForm()) != null);
        }
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            IProperty ei = DesignUtil.EditFrequentlyUsedPropertyList(project, node, _menuData, pane.Loader.DesignPane, pane.FindForm());

            return(createAction(holder, ei, pane.Loader.Writer, node, scopeMethod, actsHolder, pane.FindForm()) != null);
        }
        public override bool ExecuteMenuCommand(LimnorProject project, IClass holder, XmlNode node, MultiPanes pane, IMethod scopeMethod, IActionsHolder actsHolder)
        {
            IMethodPointer mi = DesignUtil.EditFrequentlyUsedMethodList(project, node, _menuData, pane.Loader.DesignPane, pane.FindForm());

            if (mi != null)
            {
                return(DesignUtil.OnCreateAction(holder, mi, scopeMethod, actsHolder, pane, node) != null);
            }
            return(false);
        }