mscorlib(4.0.0.0) API with additions
InternalRemotingServices.cs
1 using System.Diagnostics;
2 using System.Reflection;
7 using System.Security;
8 
10 {
12  [SecurityCritical]
13  [ComVisible(true)]
15  {
18  [SecurityCritical]
19  [Conditional("_LOGGING")]
20  public static void DebugOutChnl(string s)
21  {
22  Message.OutToUnmanagedDebugger("CHNL:" + s + "\n");
23  }
24 
27  [Conditional("_LOGGING")]
28  public static void RemotingTrace(params object[] messages)
29  {
30  }
31 
36  [Conditional("_DEBUG")]
37  public static void RemotingAssert(bool condition, string message)
38  {
39  }
40 
44  [SecurityCritical]
45  [CLSCompliant(false)]
46  public static void SetServerIdentity(MethodCall m, object srvID)
47  {
48  ((IInternalMessage)m).ServerIdentityObject = (ServerIdentity)srvID;
49  }
50 
51  internal static RemotingMethodCachedData GetReflectionCachedData(MethodBase mi)
52  {
53  RuntimeMethodInfo runtimeMethodInfo = null;
54  RuntimeConstructorInfo runtimeConstructorInfo = null;
55  if ((runtimeMethodInfo = (mi as RuntimeMethodInfo)) != null)
56  {
57  return runtimeMethodInfo.RemotingCache;
58  }
59  if ((runtimeConstructorInfo = (mi as RuntimeConstructorInfo)) != null)
60  {
61  return runtimeConstructorInfo.RemotingCache;
62  }
63  throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));
64  }
65 
66  internal static RemotingTypeCachedData GetReflectionCachedData(RuntimeType type)
67  {
68  return type.RemotingCache;
69  }
70 
71  internal static RemotingCachedData GetReflectionCachedData(MemberInfo mi)
72  {
73  MethodBase methodBase = null;
74  RuntimeType runtimeType = null;
75  RuntimeFieldInfo runtimeFieldInfo = null;
76  SerializationFieldInfo serializationFieldInfo = null;
77  if ((methodBase = (mi as MethodBase)) != null)
78  {
79  return GetReflectionCachedData(methodBase);
80  }
81  if ((runtimeType = (mi as RuntimeType)) != null)
82  {
83  return GetReflectionCachedData(runtimeType);
84  }
85  if ((runtimeFieldInfo = (mi as RuntimeFieldInfo)) != null)
86  {
87  return runtimeFieldInfo.RemotingCache;
88  }
89  if ((serializationFieldInfo = (mi as SerializationFieldInfo)) != null)
90  {
91  return serializationFieldInfo.RemotingCache;
92  }
93  throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));
94  }
95 
96  internal static RemotingCachedData GetReflectionCachedData(RuntimeParameterInfo reflectionObject)
97  {
98  return reflectionObject.RemotingCache;
99  }
100 
104  [SecurityCritical]
105  public static SoapAttribute GetCachedSoapAttribute(object reflectionObject)
106  {
107  MemberInfo memberInfo = reflectionObject as MemberInfo;
108  RuntimeParameterInfo runtimeParameterInfo = reflectionObject as RuntimeParameterInfo;
109  if (memberInfo != null)
110  {
111  return GetReflectionCachedData(memberInfo).GetSoapAttribute();
112  }
113  if (runtimeParameterInfo != null)
114  {
115  return GetReflectionCachedData(runtimeParameterInfo).GetSoapAttribute();
116  }
117  return null;
118  }
119  }
120 }
Obtains information about the attributes of a member and provides access to member metadata.
Definition: MemberInfo.cs:14
Definition: __Canon.cs:3
static void SetServerIdentity(MethodCall m, object srvID)
Sets internal identifying information for a remoted server object for each method call from client to...
Implements the T:System.Runtime.Remoting.Messaging.IMethodCallMessage interface to create a request m...
Definition: MethodCall.cs:19
static void RemotingAssert(bool condition, string message)
Instructs an internal debugger to check for a condition and display a message if the condition is fal...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
Defines utility methods for use by the .NET Framework remoting infrastructure.
Provides information about methods and constructors.
Definition: MethodBase.cs:19
The exception that is thrown when one of the arguments provided to a method is not valid.
static void DebugOutChnl(string s)
Sends a message concerning a remoting channel to an unmanaged debugger.
static SoapAttribute GetCachedSoapAttribute(object reflectionObject)
Gets an appropriate SOAP-related attribute for the specified class member or method parameter.
static void RemotingTrace(params object[] messages)
Sends any number of messages concerning remoting channels to an internal debugger.
Provides default functionality for all SOAP attributes.
Definition: SoapAttribute.cs:7