Files
2026-06-04 11:42:34 +02:00

640 lines
34 KiB
C#

using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Channels;
using Mono.Xml;
namespace System.Runtime.Remoting
{
/// <summary>Provides various static methods for configuring the remoting infrastructure.</summary>
// Token: 0x02000445 RID: 1093
[ComVisible(true)]
public static class RemotingConfiguration
{
/// <summary>Gets the ID of the currently executing application.</summary>
/// <returns>A <see cref="T:System.String" /> that contains the ID of the currently executing application.</returns>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have infrastructure permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x1700085B RID: 2139
// (get) Token: 0x06002A05 RID: 10757 RVA: 0x00086D40 File Offset: 0x00084F40
public static string ApplicationId
{
get
{
RemotingConfiguration.applicationID = RemotingConfiguration.ApplicationName;
return RemotingConfiguration.applicationID;
}
}
/// <summary>Gets or sets the name of a remoting application.</summary>
/// <returns>The name of a remoting application.</returns>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. This exception is thrown only when setting the property value. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x1700085C RID: 2140
// (get) Token: 0x06002A06 RID: 10758 RVA: 0x00086D54 File Offset: 0x00084F54
// (set) Token: 0x06002A07 RID: 10759 RVA: 0x00086D5C File Offset: 0x00084F5C
public static string ApplicationName
{
get
{
return RemotingConfiguration.applicationName;
}
set
{
RemotingConfiguration.applicationName = value;
}
}
/// <summary>Gets or sets value that indicates how custom errors are handled.</summary>
/// <returns>A member of the <see cref="T:System.Runtime.Remoting.CustomErrorsModes" /> enumeration that indicates how custom errors are handled.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x1700085D RID: 2141
// (get) Token: 0x06002A08 RID: 10760 RVA: 0x00086D64 File Offset: 0x00084F64
// (set) Token: 0x06002A09 RID: 10761 RVA: 0x00086D6C File Offset: 0x00084F6C
[MonoTODO]
public static CustomErrorsModes CustomErrorsMode
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
/// <summary>Gets the ID of the currently executing process.</summary>
/// <returns>A <see cref="T:System.String" /> that contains the ID of the currently executing process.</returns>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have infrastructure permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x1700085E RID: 2142
// (get) Token: 0x06002A0A RID: 10762 RVA: 0x00086D74 File Offset: 0x00084F74
public static string ProcessId
{
get
{
if (RemotingConfiguration.processGuid == null)
{
RemotingConfiguration.processGuid = AppDomain.GetProcessGuid();
}
return RemotingConfiguration.processGuid;
}
}
/// <summary>Reads the configuration file and configures the remoting infrastructure.</summary>
/// <param name="filename">The name of the remoting configuration file. Can be null.</param>
/// <param name="ensureSecurity">If set to true security is required. If set to false, security is not required but still may be used.</param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
// Token: 0x06002A0B RID: 10763 RVA: 0x00086D90 File Offset: 0x00084F90
[MonoTODO("Implement ensureSecurity")]
public static void Configure(string filename, bool ensureSecurity)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
lock (hashtable)
{
if (!RemotingConfiguration.defaultConfigRead)
{
RemotingConfiguration.ReadConfigFile(Environment.GetMachineConfigPath());
RemotingConfiguration.defaultConfigRead = true;
}
if (filename != null)
{
RemotingConfiguration.ReadConfigFile(filename);
}
}
}
/// <summary>Reads the configuration file and configures the remoting infrastructure. <see cref="M:System.Runtime.Remoting.RemotingConfiguration.Configure(System.String)" /> is obsolete. Please use <see cref="M:System.Runtime.Remoting.RemotingConfiguration.Configure(System.String,System.Boolean)" /> instead.</summary>
/// <param name="filename">The name of the remoting configuration file. Can be null. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <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="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A0C RID: 10764 RVA: 0x00086DF8 File Offset: 0x00084FF8
[Obsolete("Use Configure(String,Boolean)")]
public static void Configure(string filename)
{
RemotingConfiguration.Configure(filename, false);
}
// Token: 0x06002A0D RID: 10765 RVA: 0x00086E04 File Offset: 0x00085004
private static void ReadConfigFile(string filename)
{
try
{
SmallXmlParser smallXmlParser = new SmallXmlParser();
using (TextReader textReader = new StreamReader(filename))
{
ConfigHandler configHandler = new ConfigHandler(false);
smallXmlParser.Parse(textReader, configHandler);
}
}
catch (Exception ex)
{
throw new RemotingException("Configuration file '" + filename + "' could not be loaded: " + ex.Message, ex);
}
}
// Token: 0x06002A0E RID: 10766 RVA: 0x00086E9C File Offset: 0x0008509C
internal static void LoadDefaultDelayedChannels()
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
lock (hashtable)
{
if (!RemotingConfiguration.defaultDelayedConfigRead && !RemotingConfiguration.defaultConfigRead)
{
SmallXmlParser smallXmlParser = new SmallXmlParser();
using (TextReader textReader = new StreamReader(Environment.GetMachineConfigPath()))
{
ConfigHandler configHandler = new ConfigHandler(true);
smallXmlParser.Parse(textReader, configHandler);
}
RemotingConfiguration.defaultDelayedConfigRead = true;
}
}
}
/// <summary>Retrieves an array of object types registered on the client as types that will be activated remotely.</summary>
/// <returns>An array of object types registered on the client as types that will be activated remotely.</returns>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A0F RID: 10767 RVA: 0x00086F48 File Offset: 0x00085148
public static ActivatedClientTypeEntry[] GetRegisteredActivatedClientTypes()
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
ActivatedClientTypeEntry[] array2;
lock (hashtable)
{
ActivatedClientTypeEntry[] array = new ActivatedClientTypeEntry[RemotingConfiguration.activatedClientEntries.Count];
RemotingConfiguration.activatedClientEntries.Values.CopyTo(array, 0);
array2 = array;
}
return array2;
}
/// <summary>Retrieves an array of object types registered on the service end that can be activated on request from a client.</summary>
/// <returns>An array of object types registered on the service end that can be activated on request from a client.</returns>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A10 RID: 10768 RVA: 0x00086FB4 File Offset: 0x000851B4
public static ActivatedServiceTypeEntry[] GetRegisteredActivatedServiceTypes()
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
ActivatedServiceTypeEntry[] array2;
lock (hashtable)
{
ActivatedServiceTypeEntry[] array = new ActivatedServiceTypeEntry[RemotingConfiguration.activatedServiceEntries.Count];
RemotingConfiguration.activatedServiceEntries.Values.CopyTo(array, 0);
array2 = array;
}
return array2;
}
/// <summary>Retrieves an array of object types registered on the client end as well-known types.</summary>
/// <returns>An array of object types registered on the client end as well-known types.</returns>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A11 RID: 10769 RVA: 0x00087020 File Offset: 0x00085220
public static WellKnownClientTypeEntry[] GetRegisteredWellKnownClientTypes()
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
WellKnownClientTypeEntry[] array2;
lock (hashtable)
{
WellKnownClientTypeEntry[] array = new WellKnownClientTypeEntry[RemotingConfiguration.wellKnownClientEntries.Count];
RemotingConfiguration.wellKnownClientEntries.Values.CopyTo(array, 0);
array2 = array;
}
return array2;
}
/// <summary>Retrieves an array of object types registered on the service end as well-known types.</summary>
/// <returns>An array of object types registered on the service end as well-known types.</returns>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A12 RID: 10770 RVA: 0x0008708C File Offset: 0x0008528C
public static WellKnownServiceTypeEntry[] GetRegisteredWellKnownServiceTypes()
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
WellKnownServiceTypeEntry[] array2;
lock (hashtable)
{
WellKnownServiceTypeEntry[] array = new WellKnownServiceTypeEntry[RemotingConfiguration.wellKnownServiceEntries.Count];
RemotingConfiguration.wellKnownServiceEntries.Values.CopyTo(array, 0);
array2 = array;
}
return array2;
}
/// <summary>Returns a Boolean value that indicates whether the specified <see cref="T:System.Type" /> is allowed to be client activated.</summary>
/// <returns>true if the specified <see cref="T:System.Type" /> is allowed to be client activated; otherwise, false.</returns>
/// <param name="svrType">The object <see cref="T:System.Type" /> to check. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A13 RID: 10771 RVA: 0x000870F8 File Offset: 0x000852F8
public static bool IsActivationAllowed(Type svrType)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
bool flag;
lock (hashtable)
{
flag = RemotingConfiguration.activatedServiceEntries.ContainsKey(svrType);
}
return flag;
}
/// <summary>Checks whether the specified object <see cref="T:System.Type" /> is registered as a remotely activated client type.</summary>
/// <returns>The <see cref="T:System.Runtime.Remoting.ActivatedClientTypeEntry" /> that corresponds to the specified object type.</returns>
/// <param name="svrType">The object type to check. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A14 RID: 10772 RVA: 0x0008714C File Offset: 0x0008534C
public static ActivatedClientTypeEntry IsRemotelyActivatedClientType(Type svrType)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
ActivatedClientTypeEntry activatedClientTypeEntry;
lock (hashtable)
{
activatedClientTypeEntry = RemotingConfiguration.activatedClientEntries[svrType] as ActivatedClientTypeEntry;
}
return activatedClientTypeEntry;
}
/// <summary>Checks whether the object specified by its type name and assembly name is registered as a remotely activated client type.</summary>
/// <returns>The <see cref="T:System.Runtime.Remoting.ActivatedClientTypeEntry" /> that corresponds to the specified object type.</returns>
/// <param name="typeName">The type name of the object to check. </param>
/// <param name="assemblyName">The assembly name of the object to check. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A15 RID: 10773 RVA: 0x000871A4 File Offset: 0x000853A4
public static ActivatedClientTypeEntry IsRemotelyActivatedClientType(string typeName, string assemblyName)
{
return RemotingConfiguration.IsRemotelyActivatedClientType(Assembly.Load(assemblyName).GetType(typeName));
}
/// <summary>Checks whether the specified object <see cref="T:System.Type" /> is registered as a well-known client type.</summary>
/// <returns>The <see cref="T:System.Runtime.Remoting.WellKnownClientTypeEntry" /> that corresponds to the specified object type.</returns>
/// <param name="svrType">The object <see cref="T:System.Type" /> to check. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A16 RID: 10774 RVA: 0x000871B8 File Offset: 0x000853B8
public static WellKnownClientTypeEntry IsWellKnownClientType(Type svrType)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
WellKnownClientTypeEntry wellKnownClientTypeEntry;
lock (hashtable)
{
wellKnownClientTypeEntry = RemotingConfiguration.wellKnownClientEntries[svrType] as WellKnownClientTypeEntry;
}
return wellKnownClientTypeEntry;
}
/// <summary>Checks whether the object specified by its type name and assembly name is registered as a well-known client type.</summary>
/// <returns>The <see cref="T:System.Runtime.Remoting.WellKnownClientTypeEntry" /> that corresponds to the specified object type.</returns>
/// <param name="typeName">The type name of the object to check. </param>
/// <param name="assemblyName">The assembly name of the object to check. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A17 RID: 10775 RVA: 0x00087210 File Offset: 0x00085410
public static WellKnownClientTypeEntry IsWellKnownClientType(string typeName, string assemblyName)
{
return RemotingConfiguration.IsWellKnownClientType(Assembly.Load(assemblyName).GetType(typeName));
}
/// <summary>Registers an object <see cref="T:System.Type" /> recorded in the provided <see cref="T:System.Runtime.Remoting.ActivatedClientTypeEntry" /> on the client end as a type that can be activated on the server.</summary>
/// <param name="entry">Configuration settings for the client-activated type. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A18 RID: 10776 RVA: 0x00087224 File Offset: 0x00085424
public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
lock (hashtable)
{
if (RemotingConfiguration.wellKnownClientEntries.ContainsKey(entry.ObjectType) || RemotingConfiguration.activatedClientEntries.ContainsKey(entry.ObjectType))
{
throw new RemotingException("Attempt to redirect activation of type '" + entry.ObjectType.FullName + "' which is already redirected.");
}
RemotingConfiguration.activatedClientEntries[entry.ObjectType] = entry;
ActivationServices.EnableProxyActivation(entry.ObjectType, true);
}
}
/// <summary>Registers an object <see cref="T:System.Type" /> on the client end as a type that can be activated on the server, using the given parameters to initialize a new instance of the <see cref="T:System.Runtime.Remoting.ActivatedClientTypeEntry" /> class.</summary>
/// <param name="type">The object <see cref="T:System.Type" />. </param>
/// <param name="appUrl">URL of the application where this type is activated. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="typeName" /> or <paramref name="URI" /> parameter is null. </exception>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A19 RID: 10777 RVA: 0x000872CC File Offset: 0x000854CC
public static void RegisterActivatedClientType(Type type, string appUrl)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
if (appUrl == null)
{
throw new ArgumentNullException("appUrl");
}
RemotingConfiguration.RegisterActivatedClientType(new ActivatedClientTypeEntry(type, appUrl));
}
/// <summary>Registers an object type recorded in the provided <see cref="T:System.Runtime.Remoting.ActivatedServiceTypeEntry" /> on the service end as one that can be activated on request from a client.</summary>
/// <param name="entry">Configuration settings for the client-activated type. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <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="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A1A RID: 10778 RVA: 0x00087308 File Offset: 0x00085508
public static void RegisterActivatedServiceType(ActivatedServiceTypeEntry entry)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
lock (hashtable)
{
RemotingConfiguration.activatedServiceEntries.Add(entry.ObjectType, entry);
}
}
/// <summary>Registers a specified object type on the service end as a type that can be activated on request from a client.</summary>
/// <param name="type">The <see cref="T:System.Type" /> of object to register. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <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="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A1B RID: 10779 RVA: 0x0008735C File Offset: 0x0008555C
public static void RegisterActivatedServiceType(Type type)
{
RemotingConfiguration.RegisterActivatedServiceType(new ActivatedServiceTypeEntry(type));
}
/// <summary>Registers an object <see cref="T:System.Type" /> on the client end as a well-known type that can be activated on the server, using the given parameters to initialize a new instance of the <see cref="T:System.Runtime.Remoting.WellKnownClientTypeEntry" /> class.</summary>
/// <param name="type">The object <see cref="T:System.Type" />. </param>
/// <param name="objectUrl">URL of a well-known client object. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A1C RID: 10780 RVA: 0x0008736C File Offset: 0x0008556C
public static void RegisterWellKnownClientType(Type type, string objectUrl)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
if (objectUrl == null)
{
throw new ArgumentNullException("objectUrl");
}
RemotingConfiguration.RegisterWellKnownClientType(new WellKnownClientTypeEntry(type, objectUrl));
}
/// <summary>Registers an object <see cref="T:System.Type" /> recorded in the provided <see cref="T:System.Runtime.Remoting.WellKnownClientTypeEntry" /> on the client end as a well-known type that can be activated on the server.</summary>
/// <param name="entry">Configuration settings for the well-known type. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A1D RID: 10781 RVA: 0x000873A8 File Offset: 0x000855A8
public static void RegisterWellKnownClientType(WellKnownClientTypeEntry entry)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
lock (hashtable)
{
if (RemotingConfiguration.wellKnownClientEntries.ContainsKey(entry.ObjectType) || RemotingConfiguration.activatedClientEntries.ContainsKey(entry.ObjectType))
{
throw new RemotingException("Attempt to redirect activation of type '" + entry.ObjectType.FullName + "' which is already redirected.");
}
RemotingConfiguration.wellKnownClientEntries[entry.ObjectType] = entry;
ActivationServices.EnableProxyActivation(entry.ObjectType, true);
}
}
/// <summary>Registers an object <see cref="T:System.Type" /> on the service end as a well-known type, using the given parameters to initialize a new instance of <see cref="T:System.Runtime.Remoting.WellKnownServiceTypeEntry" />.</summary>
/// <param name="type">The object <see cref="T:System.Type" />. </param>
/// <param name="objectUri">The object URI. </param>
/// <param name="mode">The activation mode of the well-known object type being registered. (See <see cref="T:System.Runtime.Remoting.WellKnownObjectMode" />.) </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A1E RID: 10782 RVA: 0x00087450 File Offset: 0x00085650
public static void RegisterWellKnownServiceType(Type type, string objectUri, WellKnownObjectMode mode)
{
RemotingConfiguration.RegisterWellKnownServiceType(new WellKnownServiceTypeEntry(type, objectUri, mode));
}
/// <summary>Registers an object <see cref="T:System.Type" /> recorded in the provided <see cref="T:System.Runtime.Remoting.WellKnownServiceTypeEntry" /> on the service end as a well-known type.</summary>
/// <param name="entry">Configuration settings for the well-known type. </param>
/// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
/// </PermissionSet>
// Token: 0x06002A1F RID: 10783 RVA: 0x00087460 File Offset: 0x00085660
public static void RegisterWellKnownServiceType(WellKnownServiceTypeEntry entry)
{
Hashtable hashtable = RemotingConfiguration.channelTemplates;
lock (hashtable)
{
RemotingConfiguration.wellKnownServiceEntries[entry.ObjectUri] = entry;
RemotingServices.CreateWellKnownServerIdentity(entry.ObjectType, entry.ObjectUri, entry.Mode);
}
}
// Token: 0x06002A20 RID: 10784 RVA: 0x000874CC File Offset: 0x000856CC
internal static void RegisterChannelTemplate(ChannelData channel)
{
RemotingConfiguration.channelTemplates[channel.Id] = channel;
}
// Token: 0x06002A21 RID: 10785 RVA: 0x000874E0 File Offset: 0x000856E0
internal static void RegisterClientProviderTemplate(ProviderData prov)
{
RemotingConfiguration.clientProviderTemplates[prov.Id] = prov;
}
// Token: 0x06002A22 RID: 10786 RVA: 0x000874F4 File Offset: 0x000856F4
internal static void RegisterServerProviderTemplate(ProviderData prov)
{
RemotingConfiguration.serverProviderTemplates[prov.Id] = prov;
}
// Token: 0x06002A23 RID: 10787 RVA: 0x00087508 File Offset: 0x00085708
internal static void RegisterChannels(ArrayList channels, bool onlyDelayed)
{
foreach (object obj in channels)
{
ChannelData channelData = (ChannelData)obj;
if (!onlyDelayed || !(channelData.DelayLoadAsClientChannel != "true"))
{
if (!RemotingConfiguration.defaultDelayedConfigRead || !(channelData.DelayLoadAsClientChannel == "true"))
{
if (channelData.Ref != null)
{
ChannelData channelData2 = (ChannelData)RemotingConfiguration.channelTemplates[channelData.Ref];
if (channelData2 == null)
{
throw new RemotingException("Channel template '" + channelData.Ref + "' not found");
}
channelData.CopyFrom(channelData2);
}
foreach (object obj2 in channelData.ServerProviders)
{
ProviderData providerData = (ProviderData)obj2;
if (providerData.Ref != null)
{
ProviderData providerData2 = (ProviderData)RemotingConfiguration.serverProviderTemplates[providerData.Ref];
if (providerData2 == null)
{
throw new RemotingException("Provider template '" + providerData.Ref + "' not found");
}
providerData.CopyFrom(providerData2);
}
}
foreach (object obj3 in channelData.ClientProviders)
{
ProviderData providerData3 = (ProviderData)obj3;
if (providerData3.Ref != null)
{
ProviderData providerData4 = (ProviderData)RemotingConfiguration.clientProviderTemplates[providerData3.Ref];
if (providerData4 == null)
{
throw new RemotingException("Provider template '" + providerData3.Ref + "' not found");
}
providerData3.CopyFrom(providerData4);
}
}
ChannelServices.RegisterChannelConfig(channelData);
}
}
}
}
// Token: 0x06002A24 RID: 10788 RVA: 0x0008775C File Offset: 0x0008595C
internal static void RegisterTypes(ArrayList types)
{
foreach (object obj in types)
{
TypeEntry typeEntry = (TypeEntry)obj;
if (typeEntry is ActivatedClientTypeEntry)
{
RemotingConfiguration.RegisterActivatedClientType((ActivatedClientTypeEntry)typeEntry);
}
else if (typeEntry is ActivatedServiceTypeEntry)
{
RemotingConfiguration.RegisterActivatedServiceType((ActivatedServiceTypeEntry)typeEntry);
}
else if (typeEntry is WellKnownClientTypeEntry)
{
RemotingConfiguration.RegisterWellKnownClientType((WellKnownClientTypeEntry)typeEntry);
}
else if (typeEntry is WellKnownServiceTypeEntry)
{
RemotingConfiguration.RegisterWellKnownServiceType((WellKnownServiceTypeEntry)typeEntry);
}
}
}
/// <summary>Indicates whether the server channels in this application domain return filtered or complete exception information to local or remote callers.</summary>
/// <returns>true if only filtered exception information is returned to local or remote callers, as specified by the <paramref name="isLocalRequest" /> parameter; false if complete exception information is returned.</returns>
/// <param name="isLocalRequest">true to specify local callers; false to specify remote callers. </param>
// Token: 0x06002A25 RID: 10789 RVA: 0x00087828 File Offset: 0x00085A28
public static bool CustomErrorsEnabled(bool isLocalRequest)
{
return !(RemotingConfiguration._errorMode == "off") && (RemotingConfiguration._errorMode == "on" || !isLocalRequest);
}
// Token: 0x06002A26 RID: 10790 RVA: 0x00087868 File Offset: 0x00085A68
internal static void SetCustomErrorsMode(string mode)
{
if (mode == null)
{
throw new RemotingException("mode attribute is required");
}
string text = mode.ToLower();
if (text != "on" && text != "off" && text != "remoteonly")
{
throw new RemotingException("Invalid custom error mode: " + mode);
}
RemotingConfiguration._errorMode = text;
}
// Token: 0x0400101E RID: 4126
private static string applicationID = null;
// Token: 0x0400101F RID: 4127
private static string applicationName = null;
// Token: 0x04001020 RID: 4128
private static string processGuid = null;
// Token: 0x04001021 RID: 4129
private static bool defaultConfigRead = false;
// Token: 0x04001022 RID: 4130
private static bool defaultDelayedConfigRead = false;
// Token: 0x04001023 RID: 4131
private static string _errorMode;
// Token: 0x04001024 RID: 4132
private static Hashtable wellKnownClientEntries = new Hashtable();
// Token: 0x04001025 RID: 4133
private static Hashtable activatedClientEntries = new Hashtable();
// Token: 0x04001026 RID: 4134
private static Hashtable wellKnownServiceEntries = new Hashtable();
// Token: 0x04001027 RID: 4135
private static Hashtable activatedServiceEntries = new Hashtable();
// Token: 0x04001028 RID: 4136
private static Hashtable channelTemplates = new Hashtable();
// Token: 0x04001029 RID: 4137
private static Hashtable clientProviderTemplates = new Hashtable();
// Token: 0x0400102A RID: 4138
private static Hashtable serverProviderTemplates = new Hashtable();
}
}