Пример #1
0
 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)
                 )
             );
     }
 }
Пример #2
0
		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)
					)
				);
			}
		}