private ArgumentMapping[] DetermineParamMappings(MethodInfo method, SerializerFactory serFactory) { ParameterInfo[] parameters = method.GetParameters(); ArgumentMapping[] paramMappings = new ArgumentMapping[parameters.Length]; for (int actualParamNr = 0; actualParamNr < parameters.Length; actualParamNr++) { ParameterInfo paramInfo = parameters[actualParamNr]; // iterate through the parameters to determine mapping for each ArgumentsKind argKind = ArgumentsKind.Unknown; if (ReflectionHelper.IsInParam(paramInfo)) { argKind = ArgumentsKind.InArg; } else if (ReflectionHelper.IsOutParam(paramInfo)) { argKind = ArgumentsKind.OutArg; } else if (ReflectionHelper.IsRefParam(paramInfo)) { argKind = ArgumentsKind.RefArg; } AttributeExtCollection paramAttrs = ReflectionHelper.CollectParameterAttributes(paramInfo, method); Serializer paramSer = serFactory.Create(paramInfo.ParameterType, paramAttrs); paramMappings[actualParamNr] = new ArgumentMapping(paramSer, argKind); } return(paramMappings); }
internal ArgumentMapping(Serializer ser, ArgumentsKind kind) { m_ser = ser; m_kind = kind; }