7 internal class ArgMapper
13 private RemotingMethodCachedData _methodCachedData;
15 internal int[] Map => _map;
29 internal object[] Args
38 object[] array =
new object[_map.Length];
39 for (
int i = 0; i < _map.Length; i++)
41 array[i] = _mm.
GetArg(_map[i]);
47 internal Type[] ArgTypes
55 array =
new Type[_map.Length];
56 for (
int i = 0; i < _map.Length; i++)
65 internal string[] ArgNames
69 string[] array =
null;
73 array =
new string[_map.Length];
74 for (
int i = 0; i < _map.Length; i++)
76 array[i] = parameters[_map[i]].
Name;
91 _map = _methodCachedData.MarshalResponseArgMap;
95 _map = _methodCachedData.MarshalRequestArgMap;
105 _map = _methodCachedData.MarshalResponseArgMap;
109 _map = _methodCachedData.MarshalRequestArgMap;
114 internal object GetArg(
int argNum)
116 if (_map ==
null || argNum < 0 || argNum >= _map.Length)
120 return _mm.
GetArg(_map[argNum]);
124 internal string GetArgName(
int argNum)
126 if (_map ==
null || argNum < 0 || argNum >= _map.Length)
133 internal static void GetParameterMaps(
ParameterInfo[] parameters, out
int[] inRefArgMap, out
int[] outRefArgMap, out
int[] outOnlyArgMap, out
int[] nonRefOutArgMap, out
int[] marshalRequestMap, out
int[] marshalResponseMap)
141 int[] array =
new int[parameters.Length];
142 int[] array2 =
new int[parameters.Length];
146 bool isIn = parameterInfo.
IsIn;
147 bool isOut = parameterInfo.
IsOut;
189 array[num5++] = num7;
193 array2[num6++] = num7;
197 inRefArgMap =
new int[num];
198 outRefArgMap =
new int[num2];
199 outOnlyArgMap =
new int[num3];
200 nonRefOutArgMap =
new int[num4];
205 for (num7 = 0; num7 < parameters.Length; num7++)
208 bool isOut2 = parameterInfo2.
IsOut;
211 inRefArgMap[num++] = num7;
214 nonRefOutArgMap[num4++] = num7;
219 outRefArgMap[num2++] = num7;
220 outOnlyArgMap[num3++] = num7;
224 inRefArgMap[num++] = num7;
225 outRefArgMap[num2++] = num7;
228 marshalRequestMap =
new int[num5];
229 Array.
Copy(array, marshalRequestMap, num5);
230 marshalResponseMap =
new int[num6];
231 Array.
Copy(array2, marshalResponseMap, num6);
234 internal static object[] ExpandAsyncEndArgsToSyncArgs(RemotingMethodCachedData syncMethod,
object[] asyncEndArgs)
236 object[] array =
new object[syncMethod.Parameters.Length];
237 int[] outRefArgMap = syncMethod.OutRefArgMap;
238 for (
int i = 0; i < outRefArgMap.Length; i++)
240 array[outRefArgMap[i]] = asyncEndArgs[i];
Discovers the attributes of a parameter and provides access to parameter metadata.
MethodBase MethodBase
Gets the T:System.Reflection.MethodBase of the called method.
string GetArgName(int index)
Gets the name of the argument passed to the method.
bool IsIn
Gets a value indicating whether this is an input parameter.
Provides information about, and means to manipulate, the current environment and platform....
object GetArg(int argNum)
Gets a specific argument as an T:System.Object.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Represents type declarations: class types, interface types, array types, value types,...
Defines utility methods for use by the .NET Framework remoting infrastructure.
Provides information about methods and constructors.
Defines the method message interface.
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
bool IsOut
Gets a value indicating whether this is an output parameter.
virtual Type ParameterType
Gets the Type of this parameter.
The exception that is thrown when a method call is invalid for the object's current state.
bool IsByRef
Gets a value indicating whether the T:System.Type is passed by reference.
virtual string Name
Gets the name of the parameter.