Stetic.Wrapper.ActionTree.GetRequiredGroups C# (CSharp) Method

GetRequiredGroups() public method

public GetRequiredGroups ( ) : Stetic.Wrapper.ActionGroup[]
return Stetic.Wrapper.ActionGroup[]
        public ActionGroup[] GetRequiredGroups()
        {
            ArrayList list = new ArrayList ();
            GetRequiredGroups (list);
            return (ActionGroup[]) list.ToArray (typeof(ActionGroup));
        }

Usage Example

Example #1
0
        protected CodeExpression GenerateUiManagerElement(GeneratorContext ctx, ActionTree tree)
        {
            Widget topLevel = GetTopLevel();
            string uiName   = topLevel.UIManagerName;

            if (uiName != null)
            {
                CodeFieldReferenceExpression uiManager = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), uiName);
                if (topLevel.includedActionGroups == null)
                {
                    topLevel.includedActionGroups = new ArrayList();
                }

                // Add to the uimanager all action groups required by the
                // actions of the tree

                foreach (ActionGroup grp in tree.GetRequiredGroups())
                {
                    if (!topLevel.includedActionGroups.Contains(grp))
                    {
                        // Insert the action group in the UIManager
                        CodeMethodInvokeExpression mi = new CodeMethodInvokeExpression(
                            uiManager,
                            "InsertActionGroup",
                            ctx.GenerateValue(grp, typeof(ActionGroup)),
                            new CodePrimitiveExpression(topLevel.includedActionGroups.Count)
                            );
                        ctx.Statements.Add(mi);
                        topLevel.includedActionGroups.Add(grp);
                    }
                }

                tree.GenerateBuildCode(ctx, uiManager);
                return(new CodeMethodInvokeExpression(
                           uiManager,
                           "GetWidget",
                           new CodePrimitiveExpression("/" + Wrapped.Name)
                           ));
            }
            return(null);
        }
All Usage Examples Of Stetic.Wrapper.ActionTree::GetRequiredGroups