330 lines
14 KiB
C#
330 lines
14 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Reflection;
|
|
using System.Runtime.InteropServices;
|
|
|
|
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: 0x020003F6 RID: 1014
|
|
[ComVisible(true)]
|
|
public class MethodCallMessageWrapper : InternalMessageWrapper, IMessage, IMethodCallMessage, IMethodMessage
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.Remoting.Messaging.MethodCallMessageWrapper" /> class by wrapping an <see cref="T:System.Runtime.Remoting.Messaging.IMethodCallMessage" /> interface.</summary>
|
|
/// <param name="msg">A message that acts as an outgoing method call on a remote object.</param>
|
|
// Token: 0x06002769 RID: 10089 RVA: 0x00081608 File Offset: 0x0007F808
|
|
public MethodCallMessageWrapper(IMethodCallMessage msg)
|
|
: base(msg)
|
|
{
|
|
this._args = ((IMethodCallMessage)this.WrappedMessage).Args;
|
|
this._inArgInfo = new ArgInfo(msg.MethodBase, ArgInfoType.In);
|
|
}
|
|
|
|
/// <summary>Gets the number of arguments passed to the 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: 0x17000786 RID: 1926
|
|
// (get) Token: 0x0600276A RID: 10090 RVA: 0x00081644 File Offset: 0x0007F844
|
|
public virtual int ArgCount
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).ArgCount;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets an array of arguments passed to the 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: 0x17000787 RID: 1927
|
|
// (get) Token: 0x0600276B RID: 10091 RVA: 0x00081658 File Offset: 0x0007F858
|
|
// (set) Token: 0x0600276C RID: 10092 RVA: 0x00081660 File Offset: 0x0007F860
|
|
public virtual object[] Args
|
|
{
|
|
get
|
|
{
|
|
return this._args;
|
|
}
|
|
set
|
|
{
|
|
this._args = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating 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: 0x17000788 RID: 1928
|
|
// (get) Token: 0x0600276D RID: 10093 RVA: 0x0008166C File Offset: 0x0007F86C
|
|
public virtual bool HasVarArgs
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).HasVarArgs;
|
|
}
|
|
}
|
|
|
|
/// <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: 0x17000789 RID: 1929
|
|
// (get) Token: 0x0600276E RID: 10094 RVA: 0x00081680 File Offset: 0x0007F880
|
|
public virtual int InArgCount
|
|
{
|
|
get
|
|
{
|
|
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: 0x1700078A RID: 1930
|
|
// (get) Token: 0x0600276F RID: 10095 RVA: 0x00081690 File Offset: 0x0007F890
|
|
public virtual object[] InArgs
|
|
{
|
|
get
|
|
{
|
|
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: 0x1700078B RID: 1931
|
|
// (get) Token: 0x06002770 RID: 10096 RVA: 0x000816A4 File Offset: 0x0007F8A4
|
|
public virtual LogicalCallContext LogicalCallContext
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).LogicalCallContext;
|
|
}
|
|
}
|
|
|
|
/// <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: 0x1700078C RID: 1932
|
|
// (get) Token: 0x06002771 RID: 10097 RVA: 0x000816B8 File Offset: 0x0007F8B8
|
|
public virtual MethodBase MethodBase
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).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: 0x1700078D RID: 1933
|
|
// (get) Token: 0x06002772 RID: 10098 RVA: 0x000816CC File Offset: 0x0007F8CC
|
|
public virtual string MethodName
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).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: 0x1700078E RID: 1934
|
|
// (get) Token: 0x06002773 RID: 10099 RVA: 0x000816E0 File Offset: 0x0007F8E0
|
|
public virtual object MethodSignature
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).MethodSignature;
|
|
}
|
|
}
|
|
|
|
/// <summary>An <see cref="T:System.Collections.IDictionary" /> 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: 0x1700078F RID: 1935
|
|
// (get) Token: 0x06002774 RID: 10100 RVA: 0x000816F4 File Offset: 0x0007F8F4
|
|
public virtual IDictionary Properties
|
|
{
|
|
get
|
|
{
|
|
if (this._properties == null)
|
|
{
|
|
this._properties = new MethodCallMessageWrapper.DictionaryWrapper(this, this.WrappedMessage.Properties);
|
|
}
|
|
return this._properties;
|
|
}
|
|
}
|
|
|
|
/// <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: 0x17000790 RID: 1936
|
|
// (get) Token: 0x06002775 RID: 10101 RVA: 0x0008172C File Offset: 0x0007F92C
|
|
public virtual string TypeName
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).TypeName;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets 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: 0x17000791 RID: 1937
|
|
// (get) Token: 0x06002776 RID: 10102 RVA: 0x00081740 File Offset: 0x0007F940
|
|
// (set) Token: 0x06002777 RID: 10103 RVA: 0x00081754 File Offset: 0x0007F954
|
|
public virtual string Uri
|
|
{
|
|
get
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).Uri;
|
|
}
|
|
set
|
|
{
|
|
IInternalMessage internalMessage = this.WrappedMessage as IInternalMessage;
|
|
if (internalMessage != null)
|
|
{
|
|
internalMessage.Uri = value;
|
|
}
|
|
else
|
|
{
|
|
this.Properties["__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: 0x06002778 RID: 10104 RVA: 0x00081790 File Offset: 0x0007F990
|
|
public virtual 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.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06002779 RID: 10105 RVA: 0x0008179C File Offset: 0x0007F99C
|
|
public virtual string GetArgName(int index)
|
|
{
|
|
return ((IMethodCallMessage)this.WrappedMessage).GetArgName(index);
|
|
}
|
|
|
|
/// <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: 0x0600277A RID: 10106 RVA: 0x000817B0 File Offset: 0x0007F9B0
|
|
public virtual object GetInArg(int argNum)
|
|
{
|
|
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: 0x0600277B RID: 10107 RVA: 0x000817C8 File Offset: 0x0007F9C8
|
|
public virtual string GetInArgName(int index)
|
|
{
|
|
return this._inArgInfo.GetInOutArgName(index);
|
|
}
|
|
|
|
// Token: 0x04000F54 RID: 3924
|
|
private object[] _args;
|
|
|
|
// Token: 0x04000F55 RID: 3925
|
|
private ArgInfo _inArgInfo;
|
|
|
|
// Token: 0x04000F56 RID: 3926
|
|
private MethodCallMessageWrapper.DictionaryWrapper _properties;
|
|
|
|
// Token: 0x020003F7 RID: 1015
|
|
private class DictionaryWrapper : MethodCallDictionary
|
|
{
|
|
// Token: 0x0600277C RID: 10108 RVA: 0x000817D8 File Offset: 0x0007F9D8
|
|
public DictionaryWrapper(IMethodMessage message, IDictionary wrappedDictionary)
|
|
: base(message)
|
|
{
|
|
this._wrappedDictionary = wrappedDictionary;
|
|
base.MethodKeys = MethodCallMessageWrapper.DictionaryWrapper._keys;
|
|
}
|
|
|
|
// Token: 0x0600277E RID: 10110 RVA: 0x0008180C File Offset: 0x0007FA0C
|
|
protected override IDictionary AllocInternalProperties()
|
|
{
|
|
return this._wrappedDictionary;
|
|
}
|
|
|
|
// Token: 0x0600277F RID: 10111 RVA: 0x00081814 File Offset: 0x0007FA14
|
|
protected override void SetMethodProperty(string key, object value)
|
|
{
|
|
if (key == "__Args")
|
|
{
|
|
((MethodCallMessageWrapper)this._message)._args = (object[])value;
|
|
}
|
|
else
|
|
{
|
|
base.SetMethodProperty(key, value);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002780 RID: 10112 RVA: 0x0008184C File Offset: 0x0007FA4C
|
|
protected override object GetMethodProperty(string key)
|
|
{
|
|
if (key == "__Args")
|
|
{
|
|
return ((MethodCallMessageWrapper)this._message)._args;
|
|
}
|
|
return base.GetMethodProperty(key);
|
|
}
|
|
|
|
// Token: 0x04000F57 RID: 3927
|
|
private IDictionary _wrappedDictionary;
|
|
|
|
// Token: 0x04000F58 RID: 3928
|
|
private static string[] _keys = new string[] { "__Args" };
|
|
}
|
|
}
|
|
}
|