15 internal struct Reader
19 public bool IsNull => m_ctx ==
null;
39 return m_ctx.Principal;
45 public object HostContext
51 return m_ctx.HostContext;
68 public object GetData(
string name)
72 return m_ctx.GetData(name);
80 private const string s_CorrelationMgrSlotName =
"System.Diagnostics.Trace.CorrelationManagerSlot";
84 private CallContextRemotingData m_RemotingData;
86 private CallContextSecurityData m_SecurityData;
88 private object m_HostContext;
90 private bool m_IsCorrelationMgr;
92 private Header[] _sendHeaders;
94 private Header[] _recvHeaders;
104 if ((m_RemotingData !=
null && m_RemotingData.HasInfo) || (m_SecurityData !=
null && m_SecurityData.HasInfo) || m_HostContext !=
null || HasUserData)
112 private bool HasUserData
116 if (m_Datastore !=
null)
118 return m_Datastore.
Count > 0;
124 internal CallContextRemotingData RemotingData
128 if (m_RemotingData ==
null)
130 m_RemotingData =
new CallContextRemotingData();
132 return m_RemotingData;
136 internal CallContextSecurityData SecurityData
140 if (m_SecurityData ==
null)
142 m_SecurityData =
new CallContextSecurityData();
144 return m_SecurityData;
148 internal object HostContext
152 return m_HostContext;
156 m_HostContext = value;
164 if (m_Datastore ==
null)
176 if (m_SecurityData !=
null)
178 return m_SecurityData.Principal;
185 SecurityData.Principal = value;
189 internal LogicalCallContext()
199 if (enumerator.
Name.Equals(
"__RemotingData"))
201 m_RemotingData = (CallContextRemotingData)enumerator.
Value;
203 else if (enumerator.
Name.Equals(
"__SecurityData"))
207 m_SecurityData = (CallContextSecurityData)enumerator.
Value;
210 else if (enumerator.
Name.Equals(
"__HostContext"))
212 m_HostContext = enumerator.
Value;
214 else if (enumerator.
Name.Equals(
"__CorrelationMgrSlotPresent"))
216 m_IsCorrelationMgr = (bool)enumerator.
Value;
220 Datastore[enumerator.
Name] = enumerator.
Value;
238 info.SetType(s_callContextType);
239 if (m_RemotingData !=
null)
241 info.AddValue(
"__RemotingData", m_RemotingData);
245 info.AddValue(
"__SecurityData", m_SecurityData);
247 if (m_HostContext !=
null)
249 info.AddValue(
"__HostContext", m_HostContext);
251 if (m_IsCorrelationMgr)
253 info.AddValue(
"__CorrelationMgrSlotPresent", m_IsCorrelationMgr);
260 info.AddValue((
string)enumerator.
Key, enumerator.
Value);
267 [SecuritySafeCritical]
271 if (m_RemotingData !=
null)
273 logicalCallContext.m_RemotingData = (CallContextRemotingData)m_RemotingData.Clone();
275 if (m_SecurityData !=
null)
277 logicalCallContext.m_SecurityData = (CallContextSecurityData)m_SecurityData.Clone();
279 if (m_HostContext !=
null)
281 logicalCallContext.m_HostContext = m_HostContext;
283 logicalCallContext.m_IsCorrelationMgr = m_IsCorrelationMgr;
287 if (!m_IsCorrelationMgr)
291 logicalCallContext.Datastore[(string)enumerator.
Key] = enumerator.
Value;
298 string text = (string)enumerator.
Key;
299 if (text.Equals(
"System.Diagnostics.Trace.CorrelationManagerSlot"))
305 logicalCallContext.Datastore[text] = enumerator.
Value;
310 return logicalCallContext;
316 if (lc !=
null &&
this != lc && lc.HasUserData)
321 Datastore[(string)enumerator.
Key] = enumerator.
Value;
340 return Datastore[name];
349 Datastore[name] = data;
350 if (name.Equals(
"System.Diagnostics.Trace.CorrelationManagerSlot"))
352 m_IsCorrelationMgr =
true;
356 private Header[] InternalGetOutgoingHeaders()
358 Header[] sendHeaders = _sendHeaders;
364 internal void InternalSetHeaders(Header[] headers)
366 _sendHeaders = headers;
370 internal Header[] InternalGetHeaders()
372 if (_sendHeaders !=
null)
380 internal IPrincipal RemovePrincipalIfNotSerializable()
383 if (principal !=
null && !principal.GetType().IsSerializable)
391 internal void PropagateOutgoingHeadersToMessage(IMessage msg)
393 Header[] array = InternalGetOutgoingHeaders();
399 Header[] array2 = array;
400 foreach (Header header
in array2)
404 string propertyKeyForHeader = GetPropertyKeyForHeader(header);
405 properties[propertyKeyForHeader] = header;
410 internal static string GetPropertyKeyForHeader(Header header)
416 if (header.HeaderNamespace !=
null)
418 return header.Name +
", " + header.HeaderNamespace;
424 internal void PropagateIncomingHeadersToCallContext(IMessage msg)
426 IInternalMessage internalMessage = msg as IInternalMessage;
427 if (internalMessage !=
null && !internalMessage.HasProperties())
436 string text = (string)enumerator.
Key;
442 Header[] array =
null;
445 array =
new Header[num];
450 string text2 = (string)enumerator.
Key;
453 Header header = enumerator.
Value as Header;
456 array[num++] = header;
461 _recvHeaders = array;
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
object Clone()
Creates a new object that is a copy of the current instance.
void Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
bool MoveNext()
Advances the enumerator to the next element of the collection.
StreamingContextStates State
Gets the source or destination of the transmitted data.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
void SetData(string name, object data)
Stores the specified object in the current instance, and associates it with the specified name.
object Value
Gets the value of the item currently being examined.
bool HasInfo
Gets a value indicating whether the current T:System.Runtime.Remoting.Messaging.LogicalCallContext co...
Defines the basic functionality of a principal object.
object Key
Gets the key of the current dictionary entry.
virtual object Clone()
Creates a shallow copy of the T:System.Collections.Hashtable.
object GetData(string name)
Retrieves an object associated with the specified name from the current instance.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a specified T:System.Runtime.Serialization.SerializationInfo with the data needed to serial...
Represents a collection of key/value pairs that are organized based on the hash code of the key....
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
Represents type declarations: class types, interface types, array types, value types,...
Provides a set of properties that are carried with the execution code path during remote method calls...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Allows an object to control its own serialization and deserialization.
virtual void Remove(object key)
Removes the element with the specified key from the T:System.Collections.Hashtable.
new IDictionaryEnumerator GetEnumerator()
Returns an T:System.Collections.IDictionaryEnumerator object for the T:System.Collections....
object Value
Gets the value of the current dictionary entry.
Specifies that the class can be serialized.
Enumerates the elements of a nongeneric dictionary.
string Name
Gets the name for the item currently being examined.
StreamingContextStates
Defines a set of flags that specifies the source or destination context for the stream during seriali...
Provides a formatter-friendly mechanism for parsing the data in T:System.Runtime.Serialization....
Represents a nongeneric collection of key/value pairs.
void FreeNamedDataSlot(string name)
Empties a data slot with the specified name.
virtual int Count
Gets the number of key/value pairs contained in the T:System.Collections.Hashtable.
bool MoveNext()
Updates the enumerator to the next item.