Files
Dec2017-Script-Dump/mscorlib/System/Runtime/Remoting/InternalRemotingServices.cs
T
2026-06-04 11:42:34 +02:00

124 lines
5.3 KiB
C#

using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Metadata;
namespace System.Runtime.Remoting
{
/// <summary>Defines utility methods for use by the .NET Framework remoting infrastructure.</summary>
// Token: 0x02000442 RID: 1090
[ComVisible(true)]
public class InternalRemotingServices
{
/// <summary>Sends a message concerning a remoting channel to an unmanaged debugger. </summary>
/// <param name="s">A string to place in the message.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029E5 RID: 10725 RVA: 0x00086680 File Offset: 0x00084880
[Conditional("_LOGGING")]
public static void DebugOutChnl(string s)
{
throw new NotSupportedException();
}
/// <summary>Gets an appropriate SOAP-related attribute for the specified class member or method parameter. </summary>
/// <param name="reflectionObject">A class member or method parameter.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029E6 RID: 10726 RVA: 0x00086688 File Offset: 0x00084888
public static SoapAttribute GetCachedSoapAttribute(object reflectionObject)
{
object syncRoot = InternalRemotingServices._soapAttributes.SyncRoot;
SoapAttribute soapAttribute2;
lock (syncRoot)
{
SoapAttribute soapAttribute = InternalRemotingServices._soapAttributes[reflectionObject] as SoapAttribute;
if (soapAttribute != null)
{
soapAttribute2 = soapAttribute;
}
else
{
ICustomAttributeProvider customAttributeProvider = (ICustomAttributeProvider)reflectionObject;
object[] customAttributes = customAttributeProvider.GetCustomAttributes(typeof(SoapAttribute), true);
if (customAttributes.Length > 0)
{
soapAttribute = (SoapAttribute)customAttributes[0];
}
else if (reflectionObject is Type)
{
soapAttribute = new SoapTypeAttribute();
}
else if (reflectionObject is FieldInfo)
{
soapAttribute = new SoapFieldAttribute();
}
else if (reflectionObject is MethodBase)
{
soapAttribute = new SoapMethodAttribute();
}
else if (reflectionObject is ParameterInfo)
{
soapAttribute = new SoapParameterAttribute();
}
soapAttribute.SetReflectionObject(reflectionObject);
InternalRemotingServices._soapAttributes[reflectionObject] = soapAttribute;
soapAttribute2 = soapAttribute;
}
}
return soapAttribute2;
}
/// <summary>Instructs an internal debugger to check for a condition and display a message if the condition is false. </summary>
/// <param name="condition">true to prevent a message from being displayed; otherwise, false.</param>
/// <param name="message">The message to display if <paramref name="condition" /> is false.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029E7 RID: 10727 RVA: 0x00086790 File Offset: 0x00084990
[Conditional("_DEBUG")]
public static void RemotingAssert(bool condition, string message)
{
throw new NotSupportedException();
}
/// <summary>Sends any number of messages concerning remoting channels to an internal debugger. </summary>
/// <param name="messages">An array of type <see cref="T:System.Object" /> that contains any number of messages.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029E8 RID: 10728 RVA: 0x00086798 File Offset: 0x00084998
[Conditional("_LOGGING")]
public static void RemotingTrace(params object[] messages)
{
throw new NotSupportedException();
}
/// <summary>Sets internal identifying information for a remoted server object for each method call from client to server.</summary>
/// <param name="m">A <see cref="T:System.Runtime.Remoting.Messaging.MethodCall" /> that represents a method call on a remote object.</param>
/// <param name="srvID">Internal identifying information for a remoted server object.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029E9 RID: 10729 RVA: 0x000867A0 File Offset: 0x000849A0
[CLSCompliant(false)]
public static void SetServerIdentity(MethodCall m, object srvID)
{
Identity identity = srvID as Identity;
if (identity == null)
{
throw new ArgumentException("srvID");
}
RemotingServices.SetMessageTargetIdentity(m, identity);
}
// Token: 0x04001013 RID: 4115
private static Hashtable _soapAttributes = new Hashtable();
}
}