Exemple #1
0
            public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
            {
                CodeMethodReferenceExpression methodMarshalDictionary = new CodeMethodReferenceExpression(info.MethodExpression, info.NameBodyMethod);

                if (info.MethodTypes != null && info.MethodTypes.Length > 0)
                {
                    methodMarshalDictionary.TypeArguments.AddRange(info.MethodTypes);

                }

                CodeMethodInvokeExpression exprMarshal = CodeBuilderCommon.BuildMarshalEnumerableIn(methodMarshalDictionary, args);
                return exprMarshal;
            }
Exemple #2
0
 public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
 {
     CodeMethodInvokeExpression methodStructMarshaller = new CodeMethodInvokeExpression(CodeBuilderCommon.typerefexprMessageBuilder, "StructMarshaller",
         new CodeMethodReferenceExpression(new CodeTypeReferenceExpression(this.nameScope), "BodyAdd_" + this.nameStruct)
     );
     methodStructMarshaller.Method.TypeArguments.Add(this.typerefStruct);
     CodeMethodInvokeExpression exprMarshal = CodeBuilderCommon.BuildMarshalEnumerableStructIn(methodStructMarshaller, args);
     return exprMarshal;
 }
Exemple #3
0
            /// <summary>
            /// Create an invocation of the inner method.
            /// </summary>
            /// <param name="exprMethod">Type to call method on.</param>
            /// <param name="name">Method to call.</param>
            /// <param name="methodTypes">Generic method types.</param>
            /// <param name="args">Method arguments.</param>
            /// <returns>Invocation of method with arguments.</returns>
            public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
            {
                CodeMethodReferenceExpression methodrefMarshal = ArrayExpressionCommon.BuildCommonImpl(info.MethodExpression, info.NameBodyMethod, info.MethodTypes);

                return new CodeMethodInvokeExpression(methodrefMarshal, args);
            }
Exemple #4
0
            /// <summary>
            /// Create an invocation of the outer method.
            /// </summary>
            /// <param name="exprMethod">Type to call method on.</param>
            /// <param name="name">Method to call.</param>
            /// <param name="methodTypes">Generic method types.</param>
            /// <param name="args">Method arguments.</param>
            /// <returns>Invocation of method with arguments.
            /// Typically this is an invocation taking another (inner) method invocation as a parameter, and returning a delegate to pass to an outer invocation.
            /// </returns>
            public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
            {
                // Create the common method reference.
                CodeMethodReferenceExpression methodrefMarshal = ArrayExpressionCommon.BuildCommonImpl(info.MethodExpression, info.NameBodyMethod, info.MethodTypes);
                // Invoke the common method reference.
                CodeMethodInvokeExpression methodinvokeMarshalParam = new CodeMethodInvokeExpression(methodrefMarshal, args);

                CodeExpression[] adjustedArgs = new CodeExpression[args.Length + 2];
                args.CopyTo(adjustedArgs, 1);
                adjustedArgs[0] = info.MethodExpression;
                adjustedArgs[args.Length+1] = methodrefMarshal;
                return CodeBuilderCommon.BuildMarshalEnumerableIn(info.MethodExpression, adjustedArgs);
            }
Exemple #5
0
 public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
 {
     CodeExpression exprResult = null;
     if (this.QuSubArray) // If there is a sub-array
     {
         // Ignore calling parameters because it's this array object that knows what's what.
         exprResult = this.BuildArray();
         exprResult = this.BuildMarshalEnumerableIn(exprResult, args);
     } // Ends if there is a sub-array
     else
     {
         // Ignore calling parameters because it's this array object that knows what's what.
         exprResult = this.BuildWriteExpression(args);
     }
     return exprResult;
 }
Exemple #6
0
            public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
            {
                CodeMethodReferenceExpression methodMarshalStruct = new CodeMethodReferenceExpression(info.MethodExpression, info.NameBodyMethod);
                CodeMethodInvokeExpression exprMarshal = CodeBuilderCommon.BuildMarshalStructIn(methodMarshalStruct, args);

                return exprMarshal;
            }
Exemple #7
0
 public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
 {
     CodeMethodInvokeExpression methodStructMarshaller = new CodeMethodInvokeExpression(CodeBuilderCommon.typerefexprMessageBuilder, "StructMarshaller",
         new CodeMethodReferenceExpression(null, "BodyAdd_" + this.nameStruct)
     );
     methodStructMarshaller.Method.TypeArguments.Add(this.typerefStruct);
     return methodStructMarshaller;
 }
Exemple #8
0
                    public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
                    {
                        CodeMethodReferenceExpression methodArrayValueMarshaller = new CodeMethodReferenceExpression(info.MethodExpression, info.NameBodyMethod);

                        CodeMethodInvokeExpression exprMarshal = new CodeMethodInvokeExpression(CodeBuilderCommon.typerefexprMessageBuilder,
                            info.NameEnumerableMethod,
                            methodArrayValueMarshaller
                        );

                        return exprMarshal;
                    }
Exemple #9
0
            public CodeExpression Build(IWriteBuildInfo info, params CodeExpression[] args)
            {
                CodeExpression result;
                if (this.exprbuilderValue != null) // If got expression builder
                {
                    result = this.exprbuilderValue.Build(info, args);

                } // Ends if got expression builder
                else
                {
                    result = this.HandleBuildWriteExpression(args);
                }

                return result;
            }