Ejemplo n.º 1
0
        private GMenuItem GetMenuFrom(ActionNode n)
        {
            GMenuItem mi1 = new GMenuItem(n.Name);

            for (int index = 0; index < n.Nodes.Count; ++index)
            {
                mi1.Add(this.GetMenuFrom((ActionNode)n.Nodes[index]));
            }
            for (int index1 = 0; index1 < n.Handlers.Count; ++index1)
            {
                ActionHandler actionHandler = (ActionHandler)n.Handlers[index1];
                GMenuItem     mi2           = (GMenuItem) new GNewActionMenu(this, this.m_Macro, actionHandler);
                for (int index2 = 0; actionHandler.Params != null && index2 < actionHandler.Params.Length; ++index2)
                {
                    mi2.Add(this.GetMenuFrom(actionHandler.Params[index2], (Action)null, actionHandler));
                }
                mi1.Add(this.FormatMenu(mi2));
            }
            return(this.FormatMenu(mi1));
        }
Ejemplo n.º 2
0
        private GMenuItem GetMenuFrom(ParamNode n, Action a, ActionHandler ah)
        {
            GMenuItem mi = n.Param == null ? new GMenuItem(n.Name) : (GMenuItem) new GParamMenu(n, ah, a);

            if (n.Nodes != null)
            {
                for (int index = 0; index < n.Nodes.Length; ++index)
                {
                    mi.Add(this.GetMenuFrom(n.Nodes[index], a, ah));
                }
            }
            return(this.FormatMenu(mi));
        }