internal protected override void GenerateBuildCode(GeneratorContext ctx, CodeExpression var) { foreach (Action action in Actions) { // Create the action CodeExpression acVarExp = ctx.GenerateInstanceExpression(action, action.GenerateObjectCreation(ctx)); ctx.GenerateBuildCode(action, acVarExp); ctx.Statements.Add( new CodeMethodInvokeExpression( var, "Add", acVarExp, new CodePrimitiveExpression(action.Accelerator) ) ); } }
void GenerateSetInternalChild (GeneratorContext ctx, CodeExpression parentVar, TypedPropertyDescriptor prop) { Gtk.Widget child = prop.GetValue (container) as Gtk.Widget; Widget cwrapper = Widget.Lookup (child); if (cwrapper != null) { ctx.Statements.Add (new CodeCommentStatement ("Internal child " + Wrapped.Name + "." + prop.Name)); string childVar = ctx.NewId (); CodeVariableDeclarationStatement varDec = new CodeVariableDeclarationStatement (child.GetType().ToGlobalTypeRef (), childVar); ctx.Statements.Add (varDec); varDec.InitExpression = new CodePropertyReferenceExpression (parentVar, prop.Name); ctx.GenerateBuildCode (cwrapper, new CodeVariableReferenceExpression (childVar)); return; } }
internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) { foreach (Action action in Actions) { // Create the action CodeExpression acVarExp = ctx.GenerateInstanceExpression (action, action.GenerateObjectCreation (ctx)); ctx.GenerateBuildCode (action, acVarExp); ctx.Statements.Add ( new CodeMethodInvokeExpression ( var, "Add", acVarExp, new CodePrimitiveExpression (action.Accelerator) ) ); } }