Unity.IL2CPP.ComInterfaceWriter.BuildMethodParameterList C# (CSharp) Method

BuildMethodParameterList() static private method

static private BuildMethodParameterList ( MethodReference interopMethod, MethodReference interfaceMethod, Unity typeResolver, MarshalType marshalType, bool includeTypeNames ) : string
interopMethod Mono.Cecil.MethodReference
interfaceMethod Mono.Cecil.MethodReference
typeResolver Unity
marshalType MarshalType
includeTypeNames bool
return string
        internal static string BuildMethodParameterList(MethodReference interopMethod, MethodReference interfaceMethod, Unity.IL2CPP.ILPreProcessor.TypeResolver typeResolver, MarshalType marshalType, bool includeTypeNames)
        {
            List<string> elements = new List<string>();
            int num = 0;
            foreach (ParameterDefinition definition in interopMethod.Parameters)
            {
                MarshalInfo marshalInfo = interfaceMethod.Parameters[num].MarshalInfo;
                DefaultMarshalInfoWriter writer = MarshalDataCollector.MarshalInfoWriterFor(typeResolver.Resolve(definition.ParameterType), marshalType, marshalInfo, true, false, false, null);
                foreach (MarshaledType type in writer.MarshaledTypes)
                {
                    elements.Add(string.Format(!includeTypeNames ? "{1}" : "{0} {1}", type.DecoratedName, Naming.ForParameterName(definition) + type.VariableName));
                }
                num++;
            }
            TypeReference reference2 = typeResolver.Resolve(interopMethod.ReturnType);
            if (reference2.MetadataType != MetadataType.Void)
            {
                MarshalInfo info2 = interfaceMethod.MethodReturnType.MarshalInfo;
                MarshaledType[] marshaledTypes = MarshalDataCollector.MarshalInfoWriterFor(reference2, marshalType, info2, true, false, false, null).MarshaledTypes;
                for (int i = 0; i < (marshaledTypes.Length - 1); i++)
                {
                    elements.Add(string.Format(!includeTypeNames ? "{1}" : "{0}* {1}", marshaledTypes[i].DecoratedName, Naming.ForComInterfaceReturnParameterName() + marshaledTypes[i].VariableName));
                }
                elements.Add(string.Format(!includeTypeNames ? "{1}" : "{0}* {1}", marshaledTypes[marshaledTypes.Length - 1].DecoratedName, Naming.ForComInterfaceReturnParameterName()));
            }
            return EnumerableExtensions.AggregateWithComma(elements);
        }