665 lines
26 KiB
C#
665 lines
26 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Reflection;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace System.Runtime.Remoting.Messaging
|
|
{
|
|
/// <summary>Implements the <see cref="T:System.Runtime.Remoting.Messaging.IMethodCallMessage" /> interface to create a request message that acts as a method call on a remote object.</summary>
|
|
// Token: 0x020003F4 RID: 1012
|
|
[CLSCompliant(false)]
|
|
[ComVisible(true)]
|
|
[Serializable]
|
|
public class MethodCall : ISerializable, IInternalMessage, IMessage, IMethodCallMessage, IMethodMessage, ISerializationRootObject
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Remoting.Messaging.MethodCall" /> class from an array of remoting headers.</summary>
|
|
/// <param name="h1">An array of remoting headers that contains key/value pairs. This array is used to initialize <see cref="T:System.Runtime.Remoting.Messaging.MethodCall" /> fields for headers that belong to the namespace "http://schemas.microsoft.com/clr/soap/messageProperties".</param>
|
|
// Token: 0x06002741 RID: 10049 RVA: 0x00080B2C File Offset: 0x0007ED2C
|
|
public MethodCall(Header[] h1)
|
|
{
|
|
this.Init();
|
|
if (h1 == null || h1.Length == 0)
|
|
{
|
|
return;
|
|
}
|
|
foreach (Header header in h1)
|
|
{
|
|
this.InitMethodProperty(header.Name, header.Value);
|
|
}
|
|
this.ResolveMethod();
|
|
}
|
|
|
|
// Token: 0x06002742 RID: 10050 RVA: 0x00080B88 File Offset: 0x0007ED88
|
|
internal MethodCall(SerializationInfo info, StreamingContext context)
|
|
{
|
|
this.Init();
|
|
foreach (SerializationEntry serializationEntry in info)
|
|
{
|
|
this.InitMethodProperty(serializationEntry.Name, serializationEntry.Value);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002743 RID: 10051 RVA: 0x00080BD4 File Offset: 0x0007EDD4
|
|
internal MethodCall(CADMethodCallMessage msg)
|
|
{
|
|
this._uri = string.Copy(msg.Uri);
|
|
ArrayList arguments = msg.GetArguments();
|
|
this._args = msg.GetArgs(arguments);
|
|
this._callContext = msg.GetLogicalCallContext(arguments);
|
|
if (this._callContext == null)
|
|
{
|
|
this._callContext = new LogicalCallContext();
|
|
}
|
|
this._methodBase = msg.GetMethod();
|
|
this.Init();
|
|
if (msg.PropertiesCount > 0)
|
|
{
|
|
CADMessageBase.UnmarshalProperties(this.Properties, msg.PropertiesCount, arguments);
|
|
}
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Remoting.Messaging.MethodCall" /> class by copying an existing message.</summary>
|
|
/// <param name="msg">A remoting message.</param>
|
|
// Token: 0x06002744 RID: 10052 RVA: 0x00080C60 File Offset: 0x0007EE60
|
|
public MethodCall(IMessage msg)
|
|
{
|
|
if (msg is IMethodMessage)
|
|
{
|
|
this.CopyFrom((IMethodMessage)msg);
|
|
}
|
|
else
|
|
{
|
|
foreach (object obj in msg.Properties)
|
|
{
|
|
DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
|
|
this.InitMethodProperty((string)dictionaryEntry.Key, dictionaryEntry.Value);
|
|
}
|
|
this.Init();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002745 RID: 10053 RVA: 0x00080D0C File Offset: 0x0007EF0C
|
|
internal MethodCall(string uri, string typeName, string methodName, object[] args)
|
|
{
|
|
this._uri = uri;
|
|
this._typeName = typeName;
|
|
this._methodName = methodName;
|
|
this._args = args;
|
|
this.Init();
|
|
this.ResolveMethod();
|
|
}
|
|
|
|
// Token: 0x06002746 RID: 10054 RVA: 0x00080D40 File Offset: 0x0007EF40
|
|
internal MethodCall()
|
|
{
|
|
}
|
|
|
|
// Token: 0x17000777 RID: 1911
|
|
// (get) Token: 0x06002747 RID: 10055 RVA: 0x00080D48 File Offset: 0x0007EF48
|
|
// (set) Token: 0x06002748 RID: 10056 RVA: 0x00080D50 File Offset: 0x0007EF50
|
|
string IInternalMessage.Uri
|
|
{
|
|
get
|
|
{
|
|
return this.Uri;
|
|
}
|
|
set
|
|
{
|
|
this.Uri = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000778 RID: 1912
|
|
// (get) Token: 0x06002749 RID: 10057 RVA: 0x00080D5C File Offset: 0x0007EF5C
|
|
// (set) Token: 0x0600274A RID: 10058 RVA: 0x00080D64 File Offset: 0x0007EF64
|
|
Identity IInternalMessage.TargetIdentity
|
|
{
|
|
get
|
|
{
|
|
return this._targetIdentity;
|
|
}
|
|
set
|
|
{
|
|
this._targetIdentity = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600274B RID: 10059 RVA: 0x00080D70 File Offset: 0x0007EF70
|
|
internal void CopyFrom(IMethodMessage call)
|
|
{
|
|
this._uri = call.Uri;
|
|
this._typeName = call.TypeName;
|
|
this._methodName = call.MethodName;
|
|
this._args = call.Args;
|
|
this._methodSignature = (Type[])call.MethodSignature;
|
|
this._methodBase = call.MethodBase;
|
|
this._callContext = call.LogicalCallContext;
|
|
this.Init();
|
|
}
|
|
|
|
// Token: 0x0600274C RID: 10060 RVA: 0x00080DDC File Offset: 0x0007EFDC
|
|
internal virtual void InitMethodProperty(string key, object value)
|
|
{
|
|
switch (key)
|
|
{
|
|
case "__TypeName":
|
|
this._typeName = (string)value;
|
|
return;
|
|
case "__MethodName":
|
|
this._methodName = (string)value;
|
|
return;
|
|
case "__MethodSignature":
|
|
this._methodSignature = (Type[])value;
|
|
return;
|
|
case "__Args":
|
|
this._args = (object[])value;
|
|
return;
|
|
case "__CallContext":
|
|
this._callContext = (LogicalCallContext)value;
|
|
return;
|
|
case "__Uri":
|
|
this._uri = (string)value;
|
|
return;
|
|
case "__GenericArguments":
|
|
this._genericArguments = (Type[])value;
|
|
return;
|
|
}
|
|
this.Properties[key] = value;
|
|
}
|
|
|
|
/// <summary>The <see cref="M:System.Runtime.Remoting.Messaging.MethodCall.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" /> method is not implemented. </summary>
|
|
/// <param name="info">The data for serializing or deserializing the remote object.</param>
|
|
/// <param name="context">The context of a certain serialized stream.</param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter, Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600274D RID: 10061 RVA: 0x00080F00 File Offset: 0x0007F100
|
|
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
|
|
{
|
|
info.AddValue("__TypeName", this._typeName);
|
|
info.AddValue("__MethodName", this._methodName);
|
|
info.AddValue("__MethodSignature", this._methodSignature);
|
|
info.AddValue("__Args", this._args);
|
|
info.AddValue("__CallContext", this._callContext);
|
|
info.AddValue("__Uri", this._uri);
|
|
info.AddValue("__GenericArguments", this._genericArguments);
|
|
if (this.InternalProperties != null)
|
|
{
|
|
foreach (object obj in this.InternalProperties)
|
|
{
|
|
DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
|
|
info.AddValue((string)dictionaryEntry.Key, dictionaryEntry.Value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the number of arguments passed to a method. </summary>
|
|
/// <returns>A <see cref="T:System.Int32" /> that represents the number of arguments passed to a method.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000779 RID: 1913
|
|
// (get) Token: 0x0600274E RID: 10062 RVA: 0x00081004 File Offset: 0x0007F204
|
|
public int ArgCount
|
|
{
|
|
get
|
|
{
|
|
return this._args.Length;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets an array of arguments passed to a method. </summary>
|
|
/// <returns>An array of type <see cref="T:System.Object" /> that represents the arguments passed to a method.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700077A RID: 1914
|
|
// (get) Token: 0x0600274F RID: 10063 RVA: 0x00081010 File Offset: 0x0007F210
|
|
public object[] Args
|
|
{
|
|
get
|
|
{
|
|
return this._args;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value that indicates whether the method can accept a variable number of arguments. </summary>
|
|
/// <returns>true if the method can accept a variable number of arguments; otherwise, false.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700077B RID: 1915
|
|
// (get) Token: 0x06002750 RID: 10064 RVA: 0x00081018 File Offset: 0x0007F218
|
|
public bool HasVarArgs
|
|
{
|
|
get
|
|
{
|
|
return (this.MethodBase.CallingConvention | CallingConventions.VarArgs) != (CallingConventions)0;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the number of arguments in the method call that are not marked as out parameters.</summary>
|
|
/// <returns>A <see cref="T:System.Int32" /> that represents the number of arguments in the method call that are not marked as out parameters.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700077C RID: 1916
|
|
// (get) Token: 0x06002751 RID: 10065 RVA: 0x00081030 File Offset: 0x0007F230
|
|
public int InArgCount
|
|
{
|
|
get
|
|
{
|
|
if (this._inArgInfo == null)
|
|
{
|
|
this._inArgInfo = new ArgInfo(this._methodBase, ArgInfoType.In);
|
|
}
|
|
return this._inArgInfo.GetInOutArgCount();
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets an array of arguments in the method call that are not marked as out parameters. </summary>
|
|
/// <returns>An array of type <see cref="T:System.Object" /> that represents arguments in the method call that are not marked as out parameters.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700077D RID: 1917
|
|
// (get) Token: 0x06002752 RID: 10066 RVA: 0x00081068 File Offset: 0x0007F268
|
|
public object[] InArgs
|
|
{
|
|
get
|
|
{
|
|
if (this._inArgInfo == null)
|
|
{
|
|
this._inArgInfo = new ArgInfo(this._methodBase, ArgInfoType.In);
|
|
}
|
|
return this._inArgInfo.GetInOutArgs(this._args);
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the <see cref="T:System.Runtime.Remoting.Messaging.LogicalCallContext" /> for the current method call. </summary>
|
|
/// <returns>The <see cref="T:System.Runtime.Remoting.Messaging.LogicalCallContext" /> for the current method call.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700077E RID: 1918
|
|
// (get) Token: 0x06002753 RID: 10067 RVA: 0x000810A4 File Offset: 0x0007F2A4
|
|
public LogicalCallContext LogicalCallContext
|
|
{
|
|
get
|
|
{
|
|
if (this._callContext == null)
|
|
{
|
|
this._callContext = new LogicalCallContext();
|
|
}
|
|
return this._callContext;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the <see cref="T:System.Reflection.MethodBase" /> of the called method. </summary>
|
|
/// <returns>The <see cref="T:System.Reflection.MethodBase" /> of the called method.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x1700077F RID: 1919
|
|
// (get) Token: 0x06002754 RID: 10068 RVA: 0x000810C4 File Offset: 0x0007F2C4
|
|
public MethodBase MethodBase
|
|
{
|
|
get
|
|
{
|
|
if (this._methodBase == null)
|
|
{
|
|
this.ResolveMethod();
|
|
}
|
|
return this._methodBase;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the name of the invoked method. </summary>
|
|
/// <returns>A <see cref="T:System.String" /> that contains the name of the invoked method.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000780 RID: 1920
|
|
// (get) Token: 0x06002755 RID: 10069 RVA: 0x000810E0 File Offset: 0x0007F2E0
|
|
public string MethodName
|
|
{
|
|
get
|
|
{
|
|
if (this._methodName == null)
|
|
{
|
|
this._methodName = this._methodBase.Name;
|
|
}
|
|
return this._methodName;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets an object that contains the method signature. </summary>
|
|
/// <returns>A <see cref="T:System.Object" /> that contains the method signature.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000781 RID: 1921
|
|
// (get) Token: 0x06002756 RID: 10070 RVA: 0x00081110 File Offset: 0x0007F310
|
|
public object MethodSignature
|
|
{
|
|
get
|
|
{
|
|
if (this._methodSignature == null && this._methodBase != null)
|
|
{
|
|
ParameterInfo[] parameters = this._methodBase.GetParameters();
|
|
this._methodSignature = new Type[parameters.Length];
|
|
for (int i = 0; i < parameters.Length; i++)
|
|
{
|
|
this._methodSignature[i] = parameters[i].ParameterType;
|
|
}
|
|
}
|
|
return this._methodSignature;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets an <see cref="T:System.Collections.IDictionary" /> interface that represents a collection of the remoting message's properties. </summary>
|
|
/// <returns>An <see cref="T:System.Collections.IDictionary" /> interface that represents a collection of the remoting message's properties.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000782 RID: 1922
|
|
// (get) Token: 0x06002757 RID: 10071 RVA: 0x00081178 File Offset: 0x0007F378
|
|
public virtual IDictionary Properties
|
|
{
|
|
get
|
|
{
|
|
if (this.ExternalProperties == null)
|
|
{
|
|
this.InitDictionary();
|
|
}
|
|
return this.ExternalProperties;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002758 RID: 10072 RVA: 0x00081194 File Offset: 0x0007F394
|
|
internal virtual void InitDictionary()
|
|
{
|
|
MethodCallDictionary methodCallDictionary = new MethodCallDictionary(this);
|
|
this.ExternalProperties = methodCallDictionary;
|
|
this.InternalProperties = methodCallDictionary.GetInternalProperties();
|
|
}
|
|
|
|
/// <summary>Gets the full type name of the remote object on which the method call is being made. </summary>
|
|
/// <returns>A <see cref="T:System.String" /> that contains the full type name of the remote object on which the method call is being made.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000783 RID: 1923
|
|
// (get) Token: 0x06002759 RID: 10073 RVA: 0x000811BC File Offset: 0x0007F3BC
|
|
public string TypeName
|
|
{
|
|
get
|
|
{
|
|
if (this._typeName == null)
|
|
{
|
|
this._typeName = this._methodBase.DeclaringType.AssemblyQualifiedName;
|
|
}
|
|
return this._typeName;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets or sets the Uniform Resource Identifier (URI) of the remote object on which the method call is being made.</summary>
|
|
/// <returns>The URI of a remote object.</returns>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x17000784 RID: 1924
|
|
// (get) Token: 0x0600275A RID: 10074 RVA: 0x000811E8 File Offset: 0x0007F3E8
|
|
// (set) Token: 0x0600275B RID: 10075 RVA: 0x000811F0 File Offset: 0x0007F3F0
|
|
public string Uri
|
|
{
|
|
get
|
|
{
|
|
return this._uri;
|
|
}
|
|
set
|
|
{
|
|
this._uri = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a method argument, as an object, at a specified index. </summary>
|
|
/// <returns>The method argument as an object.</returns>
|
|
/// <param name="argNum">The index of the requested argument.</param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600275C RID: 10076 RVA: 0x000811FC File Offset: 0x0007F3FC
|
|
public object GetArg(int argNum)
|
|
{
|
|
return this._args[argNum];
|
|
}
|
|
|
|
/// <summary>Gets the name of a method argument at a specified index. </summary>
|
|
/// <returns>The name of the method argument.</returns>
|
|
/// <param name="index">The index of the requested argument.</param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600275D RID: 10077 RVA: 0x00081208 File Offset: 0x0007F408
|
|
public string GetArgName(int index)
|
|
{
|
|
return this._methodBase.GetParameters()[index].Name;
|
|
}
|
|
|
|
/// <summary>Gets a method argument at a specified index that is not marked as an out parameter. </summary>
|
|
/// <returns>The method argument that is not marked as an out parameter.</returns>
|
|
/// <param name="argNum">The index of the requested argument.</param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600275E RID: 10078 RVA: 0x0008121C File Offset: 0x0007F41C
|
|
public object GetInArg(int argNum)
|
|
{
|
|
if (this._inArgInfo == null)
|
|
{
|
|
this._inArgInfo = new ArgInfo(this._methodBase, ArgInfoType.In);
|
|
}
|
|
return this._args[this._inArgInfo.GetInOutArgIndex(argNum)];
|
|
}
|
|
|
|
/// <summary>Gets the name of a method argument at a specified index that is not marked as an out parameter.</summary>
|
|
/// <returns>The name of the method argument that is not marked as an out parameter.</returns>
|
|
/// <param name="index">The index of the requested argument. </param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x0600275F RID: 10079 RVA: 0x0008125C File Offset: 0x0007F45C
|
|
public string GetInArgName(int index)
|
|
{
|
|
if (this._inArgInfo == null)
|
|
{
|
|
this._inArgInfo = new ArgInfo(this._methodBase, ArgInfoType.In);
|
|
}
|
|
return this._inArgInfo.GetInOutArgName(index);
|
|
}
|
|
|
|
/// <summary>Initializes an internal serialization handler from an array of remoting headers that are applied to a method. </summary>
|
|
/// <returns>An internal serialization handler.</returns>
|
|
/// <param name="h">An array of remoting headers that contain key/value pairs. This array is used to initialize <see cref="T:System.Runtime.Remoting.Messaging.MethodCall" /> fields for headers that belong to the namespace "http://schemas.microsoft.com/clr/soap/messageProperties".</param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06002760 RID: 10080 RVA: 0x00081288 File Offset: 0x0007F488
|
|
[MonoTODO]
|
|
public virtual object HeaderHandler(Header[] h)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>Initializes a <see cref="T:System.Runtime.Remoting.Messaging.MethodCall" />. </summary>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06002761 RID: 10081 RVA: 0x00081290 File Offset: 0x0007F490
|
|
public virtual void Init()
|
|
{
|
|
}
|
|
|
|
/// <summary>Sets method information from previously initialized remoting message properties. </summary>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06002762 RID: 10082 RVA: 0x00081294 File Offset: 0x0007F494
|
|
public void ResolveMethod()
|
|
{
|
|
if (this._uri != null)
|
|
{
|
|
Type serverTypeForUri = RemotingServices.GetServerTypeForUri(this._uri);
|
|
if (serverTypeForUri == null)
|
|
{
|
|
string text = ((this._typeName == null) ? string.Empty : (" (" + this._typeName + ")"));
|
|
throw new RemotingException("Requested service not found" + text + ". No receiver for uri " + this._uri);
|
|
}
|
|
Type type = this.CastTo(this._typeName, serverTypeForUri);
|
|
if (type == null)
|
|
{
|
|
throw new RemotingException(string.Concat(new string[] { "Cannot cast from client type '", this._typeName, "' to server type '", serverTypeForUri.FullName, "'" }));
|
|
}
|
|
this._methodBase = RemotingServices.GetMethodBaseFromName(type, this._methodName, this._methodSignature);
|
|
if (this._methodBase == null)
|
|
{
|
|
throw new RemotingException(string.Concat(new object[] { "Method ", this._methodName, " not found in ", type }));
|
|
}
|
|
if (type != serverTypeForUri && type.IsInterface && !serverTypeForUri.IsInterface)
|
|
{
|
|
this._methodBase = RemotingServices.GetVirtualMethod(serverTypeForUri, this._methodBase);
|
|
if (this._methodBase == null)
|
|
{
|
|
throw new RemotingException(string.Concat(new object[] { "Method ", this._methodName, " not found in ", serverTypeForUri }));
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this._methodBase = RemotingServices.GetMethodBaseFromMethodMessage(this);
|
|
if (this._methodBase == null)
|
|
{
|
|
throw new RemotingException("Method " + this._methodName + " not found in " + this.TypeName);
|
|
}
|
|
}
|
|
if (this._methodBase.IsGenericMethod && this._methodBase.ContainsGenericParameters)
|
|
{
|
|
if (this.GenericArguments == null)
|
|
{
|
|
throw new RemotingException("The remoting infrastructure does not support open generic methods.");
|
|
}
|
|
this._methodBase = ((MethodInfo)this._methodBase).MakeGenericMethod(this.GenericArguments);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002763 RID: 10083 RVA: 0x0008149C File Offset: 0x0007F69C
|
|
private Type CastTo(string clientType, Type serverType)
|
|
{
|
|
clientType = MethodCall.GetTypeNameFromAssemblyQualifiedName(clientType);
|
|
if (clientType == serverType.FullName)
|
|
{
|
|
return serverType;
|
|
}
|
|
for (Type type = serverType.BaseType; type != null; type = type.BaseType)
|
|
{
|
|
if (clientType == type.FullName)
|
|
{
|
|
return type;
|
|
}
|
|
}
|
|
Type[] interfaces = serverType.GetInterfaces();
|
|
foreach (Type type2 in interfaces)
|
|
{
|
|
if (clientType == type2.FullName)
|
|
{
|
|
return type2;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Token: 0x06002764 RID: 10084 RVA: 0x0008152C File Offset: 0x0007F72C
|
|
private static string GetTypeNameFromAssemblyQualifiedName(string aqname)
|
|
{
|
|
int num = aqname.IndexOf("]]");
|
|
int num2 = aqname.IndexOf(',', (num != -1) ? (num + 2) : 0);
|
|
if (num2 != -1)
|
|
{
|
|
aqname = aqname.Substring(0, num2).Trim();
|
|
}
|
|
return aqname;
|
|
}
|
|
|
|
/// <summary>Sets method information from serialization settings. </summary>
|
|
/// <param name="info">The data for serializing or deserializing the remote object.</param>
|
|
/// <param name="ctx">The context of a given serialized stream.</param>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06002765 RID: 10085 RVA: 0x00081578 File Offset: 0x0007F778
|
|
[MonoTODO]
|
|
public void RootSetObjectData(SerializationInfo info, StreamingContext ctx)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
// Token: 0x17000785 RID: 1925
|
|
// (get) Token: 0x06002766 RID: 10086 RVA: 0x00081580 File Offset: 0x0007F780
|
|
private Type[] GenericArguments
|
|
{
|
|
get
|
|
{
|
|
if (this._genericArguments != null)
|
|
{
|
|
return this._genericArguments;
|
|
}
|
|
return this._genericArguments = this.MethodBase.GetGenericArguments();
|
|
}
|
|
}
|
|
|
|
// Token: 0x04000F46 RID: 3910
|
|
private string _uri;
|
|
|
|
// Token: 0x04000F47 RID: 3911
|
|
private string _typeName;
|
|
|
|
// Token: 0x04000F48 RID: 3912
|
|
private string _methodName;
|
|
|
|
// Token: 0x04000F49 RID: 3913
|
|
private object[] _args;
|
|
|
|
// Token: 0x04000F4A RID: 3914
|
|
private Type[] _methodSignature;
|
|
|
|
// Token: 0x04000F4B RID: 3915
|
|
private MethodBase _methodBase;
|
|
|
|
// Token: 0x04000F4C RID: 3916
|
|
private LogicalCallContext _callContext;
|
|
|
|
// Token: 0x04000F4D RID: 3917
|
|
private ArgInfo _inArgInfo;
|
|
|
|
// Token: 0x04000F4E RID: 3918
|
|
private Identity _targetIdentity;
|
|
|
|
// Token: 0x04000F4F RID: 3919
|
|
private Type[] _genericArguments;
|
|
|
|
/// <summary>An <see cref="T:System.Collections.IDictionary" /> interface that represents a collection of the remoting message's properties. </summary>
|
|
// Token: 0x04000F50 RID: 3920
|
|
protected IDictionary ExternalProperties;
|
|
|
|
/// <summary>An <see cref="T:System.Collections.IDictionary" /> interface that represents a collection of the remoting message's properties. </summary>
|
|
// Token: 0x04000F51 RID: 3921
|
|
protected IDictionary InternalProperties;
|
|
}
|
|
}
|