Insert() public method

public Insert ( int index, CodeStatement value ) : void
index int
value CodeStatement
return void
コード例 #1
0
		public void Constructor0_Deny_Unrestricted ()
		{
			CodeStatementCollection coll = new CodeStatementCollection ();
			Assert.AreEqual (0, coll.Add (cs), "Add");
			Assert.AreSame (cs, coll[0], "this[int]");
			coll.CopyTo (array, 0);
			coll.AddRange (array);
			coll.AddRange (coll);
			Assert.IsTrue (coll.Contains (cs), "Contains");
			Assert.AreEqual (0, coll.IndexOf (cs), "IndexOf");
			coll.Insert (0, cs);
			coll.Remove (cs);
		}
コード例 #2
0
    /*
     * Build first-time intialization statements
     */
    protected override void BuildInitStatements(CodeStatementCollection trueStatements, CodeStatementCollection topLevelStatements) {

        base.BuildInitStatements(trueStatements, topLevelStatements);

        // 



        CodeMemberField fileDependencies = new CodeMemberField(typeof(object), fileDependenciesName);
        fileDependencies.Attributes |= MemberAttributes.Static;
        _sourceDataClass.Members.Add(fileDependencies);

        // Note: it may look like this local variable declaration is redundant. However it is necessary
        // to make this init code re-entrant safe. This way, even if two threads enter the contructor
        // at the same time, they will not add multiple dependencies.

        // e.g. string[] dependencies;
        CodeVariableDeclarationStatement dependencies = new CodeVariableDeclarationStatement();
        dependencies.Type = new CodeTypeReference(typeof(string[]));
        dependencies.Name = dependenciesLocalName;
        // Note: it is important to add all local variables at the top level for CodeDom Subset compliance.
        topLevelStatements.Insert(0, dependencies);

        Debug.Assert(Parser.SourceDependencies != null);

        StringSet virtualDependencies = new StringSet();
        virtualDependencies.AddCollection(Parser.SourceDependencies);

        // e.g. dependencies = new string[{{virtualDependencies.Count}}];;
        CodeAssignStatement assignDependencies = new CodeAssignStatement();
        assignDependencies.Left =
            new CodeVariableReferenceExpression(dependenciesLocalName);
        assignDependencies.Right =
            new CodeArrayCreateExpression(typeof(String), virtualDependencies.Count);
        trueStatements.Add(assignDependencies);

        int i = 0;
        foreach (string virtualDependency in virtualDependencies) {
            // e.g. dependencies[i] = "~/sub/foo.aspx";
            CodeAssignStatement addFileDep = new CodeAssignStatement();
            addFileDep.Left =
                new CodeArrayIndexerExpression(
                    new CodeVariableReferenceExpression(dependenciesLocalName),
                    new CodeExpression[] {new CodePrimitiveExpression(i++)});
            string src = UrlPath.MakeVirtualPathAppRelative(virtualDependency);
            addFileDep.Right = new CodePrimitiveExpression(src);
            trueStatements.Add(addFileDep);
        }

        // e.g. __fileDependencies = this.GetWrappedFileDependencies(dependencies);
        CodeAssignStatement initFile = new CodeAssignStatement();
        initFile.Left = new CodeFieldReferenceExpression(_classTypeExpr, fileDependenciesName);
        CodeMethodInvokeExpression createWrap = new CodeMethodInvokeExpression();
        createWrap.Method.TargetObject = new CodeThisReferenceExpression();
        createWrap.Method.MethodName = "GetWrappedFileDependencies";
        createWrap.Parameters.Add(new CodeVariableReferenceExpression(dependenciesLocalName));
        initFile.Right = createWrap;

#if DBG
        AppendDebugComment(trueStatements);
#endif
        trueStatements.Add(initFile);
    }
コード例 #3
0
		CodeMemberMethod GenerateMethod (CodeIdentifiers memberIds, SoapOperationBinding soapOper, SoapBodyBinding bodyBinding, XmlMembersMapping inputMembers, XmlMembersMapping outputMembers)
		{
			CodeIdentifiers pids = new CodeIdentifiers ();
			CodeMemberMethod method = new CodeMemberMethod ();
			CodeMemberMethod methodBegin = new CodeMemberMethod ();
			CodeMemberMethod methodEnd = new CodeMemberMethod ();
			method.Attributes = MemberAttributes.Public | MemberAttributes.Final;
			methodBegin.Attributes = MemberAttributes.Public | MemberAttributes.Final;
			methodEnd.Attributes = MemberAttributes.Public | MemberAttributes.Final;
			
			SoapBindingStyle style = soapOper.Style != SoapBindingStyle.Default ? soapOper.Style : soapBinding.Style;
			
			// Find unique names for temporary variables
			
			for (int n=0; n<inputMembers.Count; n++)
				pids.AddUnique (inputMembers[n].MemberName, inputMembers[n]);

			if (outputMembers != null)
				for (int n=0; n<outputMembers.Count; n++)
					pids.AddUnique (outputMembers[n].MemberName, outputMembers[n]);
				
			string varAsyncResult = pids.AddUnique ("asyncResult","asyncResult");
			string varResults = pids.AddUnique ("results","results");
			string varCallback = pids.AddUnique ("callback","callback");
			string varAsyncState = pids.AddUnique ("asyncState","asyncState");

			string messageName = memberIds.AddUnique(CodeIdentifier.MakeValid(Operation.Name),method);

			method.Name = CodeIdentifier.MakeValid(Operation.Name);
			if (method.Name == ClassName) method.Name += "1";
			methodBegin.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("Begin" + method.Name),method);
			methodEnd.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("End" + method.Name),method);

			method.ReturnType = new CodeTypeReference (typeof(void));
			methodEnd.ReturnType = new CodeTypeReference (typeof(void));
			methodEnd.Parameters.Add (new CodeParameterDeclarationExpression (typeof (IAsyncResult),varAsyncResult));

			CodeExpression[] paramArray = new CodeExpression [inputMembers.Count];
			CodeParameterDeclarationExpression[] outParams = new CodeParameterDeclarationExpression [outputMembers != null ? outputMembers.Count : 0];

			for (int n=0; n<inputMembers.Count; n++)
			{
				CodeParameterDeclarationExpression param = GenerateParameter (inputMembers[n], FieldDirection.In);
				method.Parameters.Add (param);
				GenerateMemberAttributes (inputMembers, inputMembers[n], bodyBinding.Use, param);
				methodBegin.Parameters.Add (GenerateParameter (inputMembers[n], FieldDirection.In));
				paramArray [n] = new CodeVariableReferenceExpression (param.Name);
			}

			if (outputMembers != null)
			{
				bool hasReturn = false;
				for (int n=0; n<outputMembers.Count; n++)
				{
					CodeParameterDeclarationExpression cpd = GenerateParameter (outputMembers[n], FieldDirection.Out);
					outParams [n] = cpd;
					
					bool found = false;
					foreach (CodeParameterDeclarationExpression ip in method.Parameters)
					{
						if (ip.Name == cpd.Name && ip.Type.BaseType == cpd.Type.BaseType) {
							ip.Direction = FieldDirection.Ref;
							methodEnd.Parameters.Add (GenerateParameter (outputMembers[n], FieldDirection.Out));
							found = true;
							break;
						}
					}
					
					if (found) continue;
	
					if (!hasReturn) 
					{
						hasReturn = true;
						method.ReturnType = cpd.Type;
						methodEnd.ReturnType = cpd.Type;
						GenerateReturnAttributes (outputMembers, outputMembers[n], bodyBinding.Use, method);
						outParams [n] = null;
						continue;
					}
					
					method.Parameters.Add (cpd);
					GenerateMemberAttributes (outputMembers, outputMembers[n], bodyBinding.Use, cpd);
					methodEnd.Parameters.Add (GenerateParameter (outputMembers[n], FieldDirection.Out));
				}
			}
			
			methodBegin.Parameters.Add (new CodeParameterDeclarationExpression (typeof (AsyncCallback),varCallback));
			methodBegin.Parameters.Add (new CodeParameterDeclarationExpression (typeof (object),varAsyncState));
			methodBegin.ReturnType = new CodeTypeReference (typeof(IAsyncResult));

			// Array of input parameters
			
			CodeArrayCreateExpression methodParams;
			if (paramArray.Length > 0)
				methodParams = new CodeArrayCreateExpression (typeof(object), paramArray);
			else
				methodParams = new CodeArrayCreateExpression (typeof(object), 0);

			// Assignment of output parameters
			
			CodeStatementCollection outAssign = new CodeStatementCollection ();
			CodeVariableReferenceExpression arrVar = new CodeVariableReferenceExpression (varResults);
			for (int n=0; n<outParams.Length; n++)
			{
				CodeExpression index = new CodePrimitiveExpression (n);
				if (outParams[n] == null)
				{
					CodeExpression res = new CodeCastExpression (method.ReturnType, new CodeArrayIndexerExpression (arrVar, index));
					outAssign.Add (new CodeMethodReturnStatement (res));
				}
				else
				{
					CodeExpression res = new CodeCastExpression (outParams[n].Type, new CodeArrayIndexerExpression (arrVar, index));
					CodeExpression var = new CodeVariableReferenceExpression (outParams[n].Name);
					outAssign.Insert (0, new CodeAssignStatement (var, res));
				}
			}
			
			if (Style == ServiceDescriptionImportStyle.Client) 
			{
				// Invoke call
				
				CodeThisReferenceExpression ethis = new CodeThisReferenceExpression();
				CodePrimitiveExpression varMsgName = new CodePrimitiveExpression (messageName);
				CodeMethodInvokeExpression inv;
				CodeVariableDeclarationStatement dec;
	
				inv = new CodeMethodInvokeExpression (ethis, "Invoke", varMsgName, methodParams);
				if (outputMembers != null && outputMembers.Count > 0)
				{
					dec = new CodeVariableDeclarationStatement (typeof(object[]), varResults, inv);
					method.Statements.Add (dec);
					method.Statements.AddRange (outAssign);
				}
				else
					method.Statements.Add (inv);
				
				// Begin Invoke Call
				
				CodeExpression expCallb = new CodeVariableReferenceExpression (varCallback);
				CodeExpression expAsyncs = new CodeVariableReferenceExpression (varAsyncState);
				inv = new CodeMethodInvokeExpression (ethis, "BeginInvoke", varMsgName, methodParams, expCallb, expAsyncs);
				methodBegin.Statements.Add (new CodeMethodReturnStatement (inv));
				
				// End Invoke call
				
				CodeExpression varAsyncr = new CodeVariableReferenceExpression (varAsyncResult);
				inv = new CodeMethodInvokeExpression (ethis, "EndInvoke", varAsyncr);
				if (outputMembers != null && outputMembers.Count > 0)
				{
					dec = new CodeVariableDeclarationStatement (typeof(object[]), varResults, inv);
					methodEnd.Statements.Add (dec);
					methodEnd.Statements.AddRange (outAssign);
				}
				else
					methodEnd.Statements.Add (inv);
			}
			else {
				method.Attributes = MemberAttributes.Public | MemberAttributes.Abstract;
			}
			
			// Attributes
			
			ImportHeaders (method);
			
			CodeAttributeDeclaration att = new CodeAttributeDeclaration ("System.Web.Services.WebMethodAttribute");
			if (messageName != method.Name) att.Arguments.Add (GetArg ("MessageName",messageName));
			AddCustomAttribute (method, att, (Style == ServiceDescriptionImportStyle.Server));
			
			if (style == SoapBindingStyle.Rpc)
			{
				att = new CodeAttributeDeclaration ("System.Web.Services.Protocols.SoapRpcMethodAttribute");
				att.Arguments.Add (GetArg (soapOper.SoapAction));
				if (inputMembers.ElementName != method.Name) att.Arguments.Add (GetArg ("RequestElementName", inputMembers.ElementName));
				if (outputMembers != null && outputMembers.ElementName != (method.Name + "Response")) att.Arguments.Add (GetArg ("ResponseElementName", outputMembers.ElementName));
				att.Arguments.Add (GetArg ("RequestNamespace", inputMembers.Namespace));
				if (outputMembers != null) att.Arguments.Add (GetArg ("ResponseNamespace", outputMembers.Namespace));
				if (outputMembers == null) att.Arguments.Add (GetArg ("OneWay", true));
			}
			else
			{
				if (outputMembers != null && (inputMembers.ElementName == "" && outputMembers.ElementName != "" || 
					inputMembers.ElementName != "" && outputMembers.ElementName == ""))
					throw new InvalidOperationException ("Parameter style is not the same for the input message and output message");
	
				att = new CodeAttributeDeclaration ("System.Web.Services.Protocols.SoapDocumentMethodAttribute");
				att.Arguments.Add (GetArg (soapOper.SoapAction));
				if (inputMembers.ElementName != "") {
					if (inputMembers.ElementName != method.Name) att.Arguments.Add (GetArg ("RequestElementName", inputMembers.ElementName));
					if (outputMembers != null && outputMembers.ElementName != (method.Name + "Response")) att.Arguments.Add (GetArg ("ResponseElementName", outputMembers.ElementName));
					att.Arguments.Add (GetArg ("RequestNamespace", inputMembers.Namespace));
					if (outputMembers != null) att.Arguments.Add (GetArg ("ResponseNamespace", outputMembers.Namespace));
					att.Arguments.Add (GetEnumArg ("ParameterStyle", "System.Web.Services.Protocols.SoapParameterStyle", "Wrapped"));
				}
				else
					att.Arguments.Add (GetEnumArg ("ParameterStyle", "System.Web.Services.Protocols.SoapParameterStyle", "Bare"));
					
				if (outputMembers == null) att.Arguments.Add (GetArg ("OneWay", true));
					
				att.Arguments.Add (GetEnumArg ("Use", "System.Web.Services.Description.SoapBindingUse", bodyBinding.Use.ToString()));
			}
			
			AddCustomAttribute (method, att, true);
			
			CodeTypeDeclaration.Members.Add (method);
			
			if (Style == ServiceDescriptionImportStyle.Client) {
				CodeTypeDeclaration.Members.Add (methodBegin);
				CodeTypeDeclaration.Members.Add (methodEnd);
			}
			
			return method;
		}
コード例 #4
0
        private void CorrectStatements(string name, CodeStatementCollection stmts, CodeTypeReference returnType)
        {
            _name = name;
            _referenceCount = 0;
            new CodeDomWalker(stmts).Walk(RenameReturnValue);
            _name = null;

            CodeObjectSource source = Utils.GetTypeReferenceSource(returnType);
            Type type = (source == null ? null : source.Target as Type);
            CodeExpression defaultExpr = (type != null && type.IsPrimitive
                                              ? (CodeExpression) new CodeDefaultValueExpression(returnType)
                                              : new CodePrimitiveExpression(null));
            CodeExpression returnExpr = null;

            if (_referenceCount > 0)
            {
                bool requiresDeclaration = true;
                CodeAssignStatement assignStmt = stmts[stmts.Count - 1] as CodeAssignStatement;

                if (assignStmt != null)
                {
                    CodeVariableReferenceExpression variableStmt = assignStmt.Left as CodeVariableReferenceExpression;

                    if (variableStmt != null && StringUtils.CaseInsensitiveEquals(variableStmt.VariableName, _returnVariableName))
                    {
                        stmts.RemoveAt(stmts.Count - 1);
                        returnExpr = assignStmt.Right;
                        requiresDeclaration = (_referenceCount > 1);
                    }
                }

                if (requiresDeclaration)
                {
                    CodeExpression initExpression = null;
                    assignStmt = stmts[0] as CodeAssignStatement;

                    if (assignStmt != null)
                    {
                        CodeVariableReferenceExpression variableStmt = assignStmt.Left as CodeVariableReferenceExpression;

                        if (variableStmt != null && StringUtils.CaseInsensitiveEquals(variableStmt.VariableName, _returnVariableName))
                        {
                            stmts.RemoveAt(0);
                            initExpression = assignStmt.Right;
                        }
                    }

                    if (initExpression == null)
                    {
                        initExpression = defaultExpr;
                    }

                    stmts.Insert(
                        0,
                        new CodeVariableDeclarationStatement(
                            returnType,
                            _returnVariableName,
                            initExpression));
                }

                if (returnExpr == null)
                {
                    returnExpr = new CodeVariableReferenceExpression(_returnVariableName);
                }
            }
            else
            {
                returnExpr = defaultExpr;
            }

            stmts.Add(new CodeMethodReturnStatement(returnExpr));
        }
 protected override void BuildInitStatements(CodeStatementCollection trueStatements, CodeStatementCollection topLevelStatements)
 {
     CodeMemberField field;
     base.BuildInitStatements(trueStatements, topLevelStatements);
     field = new CodeMemberField(typeof(object), "__fileDependencies") {
         Attributes = field.Attributes | MemberAttributes.Static
     };
     base._sourceDataClass.Members.Add(field);
     CodeVariableDeclarationStatement statement = new CodeVariableDeclarationStatement {
         Type = new CodeTypeReference(typeof(string[])),
         Name = "dependencies"
     };
     topLevelStatements.Insert(0, statement);
     StringSet set = new StringSet();
     set.AddCollection(this.Parser.SourceDependencies);
     CodeAssignStatement statement2 = new CodeAssignStatement {
         Left = new CodeVariableReferenceExpression("dependencies"),
         Right = new CodeArrayCreateExpression(typeof(string), set.Count)
     };
     trueStatements.Add(statement2);
     int num = 0;
     foreach (string str in (IEnumerable) set)
     {
         CodeAssignStatement statement3 = new CodeAssignStatement {
             Left = new CodeArrayIndexerExpression(new CodeVariableReferenceExpression("dependencies"), new CodeExpression[] { new CodePrimitiveExpression(num++) })
         };
         string str2 = UrlPath.MakeVirtualPathAppRelative(str);
         statement3.Right = new CodePrimitiveExpression(str2);
         trueStatements.Add(statement3);
     }
     CodeAssignStatement statement4 = new CodeAssignStatement {
         Left = new CodeFieldReferenceExpression(base._classTypeExpr, "__fileDependencies")
     };
     CodeMethodInvokeExpression expression = new CodeMethodInvokeExpression {
         Method = { TargetObject = new CodeThisReferenceExpression(), MethodName = "GetWrappedFileDependencies" }
     };
     expression.Parameters.Add(new CodeVariableReferenceExpression("dependencies"));
     statement4.Right = expression;
     trueStatements.Add(statement4);
 }
コード例 #6
0
        public virtual void HandleResponse(string idlMethodName, CodeStatementCollection statementsTryRecv, List<CodeStatement> statementsReponse)
        {
            // Create message reader.
            // * Udbus.Core.UdbusMessageReader reader = new Udbus.Core.UdbusMessageReader(msgHandleResp);
            statementsTryRecv.Insert(0, this.CreateMessageReader());

            // * Udbus.Core.NMessageHandle.UdbusMessageHandle msgHandleResp = null;
            statementsReponse.Add(this.DeclareResponseVariable());
            CodeTryCatchFinallyStatement trycatchReceive = this.ReceiveMessage(idlMethodName, statementsTryRecv);
            statementsReponse.Add(trycatchReceive);
        }
コード例 #7
0
		private static void BuildLogic(CodeStatementCollection statements, ReadOnlyArrayCollection<ParticleSystemLogicStep> steps, bool addMethod)
		{
			Dictionary<string, bool> argsUsed = new Dictionary<string, bool>();
			foreach (string arg in memberTranslate.Keys)
				argsUsed.Add(arg, false);
			argsUsed.Add("rand", false);

			CodeStatementCollection code = new CodeStatementCollection();
			BuildLogic(code, steps, argsUsed, 0);

			//rand requires a local variable
			if (argsUsed["rand"])
				statements.Add(
					new CodeVariableDeclarationStatement(
						typeof(float), "_tmp", new CodePrimitiveExpression(0.0f)));

			for (int i = 0; i < 4; i++)
			{
				if (argsUsed["local" + i])
				{
					code.Insert(0,
						new CodeVariableDeclarationStatement(
							typeof(float), "local"+i, new CodePrimitiveExpression(0.0f)));
				}
			}

			CodeVariableReferenceExpression ref_i = new CodeVariableReferenceExpression("i");

			if (addMethod) // add methods have indices to update...
				ref_i.VariableName = "_i";

			CodeIterationStatement loop = new CodeIterationStatement();
			loop.InitStatement = new CodeVariableDeclarationStatement(typeof(uint), ref_i.VariableName, new CodePrimitiveExpression(0));
			loop.IncrementStatement = new CodeAssignStatement(ref_i,new CodeBinaryOperatorExpression(ref_i, CodeBinaryOperatorType.Add, new CodePrimitiveExpression((uint)1)));
			loop.TestExpression = new CodeBinaryOperatorExpression(ref_i, CodeBinaryOperatorType.LessThan, new CodeArgumentReferenceExpression("count"));

			// uint i = indices[_i];
			if (addMethod)
				loop.Statements.Add(new CodeVariableDeclarationStatement(typeof(uint), "i", new CodeArrayIndexerExpression(new CodeArgumentReferenceExpression("indices"), ref_i)));
			else
			{
				//put in velocity logic

				loop.Statements.Add(
					new CodeAssignStatement(Arg("position.x"),
						new CodeBinaryOperatorExpression(Arg("position.x"), CodeBinaryOperatorType.Add,
							new CodeBinaryOperatorExpression(Arg("velocity.x"), CodeBinaryOperatorType.Multiply, Arg("delta_time")))));

				loop.Statements.Add(
					new CodeAssignStatement(Arg("position.y"),
						new CodeBinaryOperatorExpression(Arg("position.y"), CodeBinaryOperatorType.Add,
							new CodeBinaryOperatorExpression(Arg("velocity.y"), CodeBinaryOperatorType.Multiply, Arg("delta_time")))));

				loop.Statements.Add(
					new CodeAssignStatement(Arg("position.z"),
						new CodeBinaryOperatorExpression(Arg("position.z"), CodeBinaryOperatorType.Add,
							new CodeBinaryOperatorExpression(Arg("velocity.z"), CodeBinaryOperatorType.Multiply, Arg("delta_time")))));
			}

			loop.Statements.AddRange(code);

			statements.Add(loop);
		}
コード例 #8
0
		public void Insert_Null ()
		{
			CodeStatementCollection coll = new CodeStatementCollection ();
			coll.Insert (0, (CodeStatement) null);
		}
コード例 #9
0
		public void Insert ()
		{
			CodeStatement cs1 = new CodeStatement ();
			CodeStatement cs2 = new CodeStatement ();

			CodeStatementCollection coll = new CodeStatementCollection ();
			coll.Add (cs1);
			Assert.AreEqual (1, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (cs1), "#2");
			coll.Insert (0, cs2);
			Assert.AreEqual (2, coll.Count, "#3");
			Assert.AreEqual (1, coll.IndexOf (cs1), "#4");
			Assert.AreEqual (0, coll.IndexOf (cs2), "#5");
		}
コード例 #10
0
        static public void MakeSignalParameters(CodeTypeDeclaration typedeclArgs,
            CodeTypeFactory codetypefactoryOut,
            Udbus.Parsing.CodeMemberDeferredClassHolder declarationHolder,
            IDLInterface idlIntf,
            string methodName,
            string idlSignalName,
            IList<IDLSignalArgument> arguments,
            CodeParameterDeclarationExpressionCollection parameters,
            CodeStatementCollection statements,
            Udbus.Parsing.BuildContext context,
            MarshalBuilderHelper codebuilder)
        {
            CodeStatementCollection statementsTryRecv = new CodeStatementCollection();
            int nOutArgCounter = 0;
            List<CodeMethodInvokeExpression> invokemethodsBuild = new List<CodeMethodInvokeExpression>();
            CodeConditionStatement condOut = null; // Root if statement for out parameters.
            CodeConditionStatement condOutIter = null; // Most nested if statement for out parameters.
            CodeStatementCollection stmtsFinishResult = new CodeStatementCollection();
            CodeTypeReference typerefParamIter = CodeBuilderCommon.typerefUnknownParameters;
            string argNameIter = arguments != null && arguments.Count > 0 ? arguments[0].Name : "UnknownParameters";

            CodeThrowExceptionStatement throwargOutPrev = codebuilder.CreateArgumentOutException(idlSignalName);

            // WAXME
            //CodeConstructor constructorArgs = new CodeConstructor();
            //constructorArgs.Attributes = MemberAttributes.Public;
            foreach (IDLSignalArgument idlSignalArg in arguments)
            {
                argNameIter = idlSignalArg.Name;

                // Parse the type string for the argument, creating required structs as we go, and returning a type for the argument.
                //Udbus.Parsing.IDLArgumentTypeNameBuilderBase nameBuilder = new IDLMethodArgumentTypeNameBuilder(idlIntf, idlMethod, idlMethodArg);
                Udbus.Parsing.IDLArgumentTypeNameBuilderBase nameBuilder = new IDLArgumentTypeNameBuilder(idlIntf, methodName);
                ParamCodeTypeHolderMarshalBase paramtypeHolder = null;
                CodeTypeReference typerefParam = null;
                if (condOut == null)
                {
                    codebuilder.PrefixOutParams(ref condOut, ref condOutIter, idlSignalName, ref nOutArgCounter, ref throwargOutPrev);
                }

                // Handle the signal argument in the message.
                CodeConditionStatement condVarResult;
                codebuilder.MakeOutArgument(statements
                    , stmtsFinishResult
                    , idlSignalName
                    , codetypefactoryOut // Yeah I messed up the naming
                    , ref nOutArgCounter
                    , context
                    , ref throwargOutPrev
                    , idlSignalArg
                    , nameBuilder
                    , ref paramtypeHolder
                    , ref typerefParam
                    , out condVarResult
                );

                codebuilder.StoreCondIterator(ref condOut, ref condOutIter, condVarResult);

                // WAXME
                // Add a field to the <signal>Args class.
                //string argFieldName = CodeBuilderCommon.GetSignalArgFieldName(idlSignalArg.Name);
                //CodeFieldReferenceExpression fielrefdRefArgField = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), argFieldName);
                //typedeclArgs.Members.Add(new CodeMemberField(paramtypeHolder.paramtype.CodeType, argFieldName));
                //CodeMemberProperty propArgField = new CodeMemberProperty();
                //propArgField.Attributes = MemberAttributes.Public | MemberAttributes.Final;
                //propArgField.Type = paramtypeHolder.paramtype.CodeType;
                //propArgField.Name = PropertyNameFromFieldName(argFieldName);
                //propArgField.GetStatements.Add(new CodeMethodReturnStatement(fielrefdRefArgField));
                //typedeclArgs.Members.Add(propArgField);
                //constructorArgs.Parameters.Add(new CodeParameterDeclarationExpression(paramtypeHolder.paramtype.CodeType, argFieldName));
                //// * this.<signal_arg> = <signal_arg>;
                //constructorArgs.Statements.Add(new CodeAssignStatement(fielrefdRefArgField, new CodeArgumentReferenceExpression(argFieldName)));

            } // Ends loop over arguments

            //typedeclArgs.Members.Add(constructorArgs);

            codebuilder.AssignResults(statementsTryRecv, condOut, condOutIter, stmtsFinishResult, throwargOutPrev
                , idlSignalName, ref nOutArgCounter
            );
            List<CodeStatement> statementsReponse = new List<CodeStatement>();

            // Now receive the response.
            // Create message reader.
            // * Udbus.Core.UdbusMessageReader reader = new Udbus.Core.UdbusMessageReader(msgHandleResp);
            statementsTryRecv.Insert(0, codebuilder.CreateMessageReader());
            statementsReponse.AddRange(statementsTryRecv.Cast<CodeStatement>());
            statements.Add(new CodeConditionStatement(exprResultOk, statementsReponse.ToArray()));
        }