LogicalCallContext LogicalCallContext LogicalCallContext LogicalCallContext Class

定义

提供在进行远程方法调用期间用执行代码路径传送的一组属性。Provides a set of properties that are carried with the execution code path during remote method calls.

public ref class LogicalCallContext sealed : ICloneable, System::Runtime::Serialization::ISerializable
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.SecurityCritical]
[System.Serializable]
public sealed class LogicalCallContext : ICloneable, System.Runtime.Serialization.ISerializable
type LogicalCallContext = class
    interface ISerializable
    interface ICloneable
Public NotInheritable Class LogicalCallContext
Implements ICloneable, ISerializable
继承
LogicalCallContextLogicalCallContextLogicalCallContextLogicalCallContext
属性
实现

注解

类是在方法调用到远程CallContext应用程序域期间使用的类的版本。 LogicalCallContextThe LogicalCallContext class is a version of the CallContext class that is used during method calls to remote application domains. CallContext是一个专用集合对象, 它类似于方法调用的线程本地存储, 并提供对每个执行逻辑线程唯一的数据槽。The CallContext is a specialized collection object similar to a thread local storage for method calls, and provides data slots that are unique to each logical thread of execution. 不会在其他逻辑线程上跨调用上下文共享槽。The slots are not shared across call contexts on other logical threads. 当对象沿执行代码路径CallContext向下和按路径中的各个对象进行检查时, 可以将对象添加到中。Objects can be added to the CallContext as it travels down and up the execution code path, and examined by various objects along the path.

当对另AppDomain一个中的对象进行远程方法调用时CallContext , 类将生成一个LogicalCallContext与远程调用一起传输的。When a remote method call is made to an object in another AppDomain, the CallContext class generates a LogicalCallContext that travels along with the remote call. 只有公开ILogicalThreadAffinative接口并存储CallContext在中的对象才会LogicalCallContext传播到中的AppDomain外部。Only objects that expose the ILogicalThreadAffinative interface and are stored in the CallContext are propagated outside the AppDomain in a LogicalCallContext. 不支持此接口的对象不在具有远程方法LogicalCallContext调用的实例中传输。Objects that do not support this interface are not transmitted in LogicalCallContext instances with remote method calls.

备注

此类发出链接请求。This class makes a link demand. 如果直接调用方没有基础结构权限, 则会引发 SecurityException。A SecurityException is thrown if the immediate caller does not have infrastructure permission. 有关详细信息, 请参阅链接要求See Link Demands for more information.

属性

HasInfo HasInfo HasInfo HasInfo

获取一个值,该值指示当前的 LogicalCallContext 是否包含信息。Gets a value indicating whether the current LogicalCallContext contains information.

方法

Clone() Clone() Clone() Clone()

创建作为当前实例副本的新对象。Creates a new object that is a copy of the current instance.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
FreeNamedDataSlot(String) FreeNamedDataSlot(String) FreeNamedDataSlot(String) FreeNamedDataSlot(String)

清空具有指定名称的数据槽。Empties a data slot with the specified name.

GetData(String) GetData(String) GetData(String) GetData(String)

检索与当前实例中的指定名称关联的对象。Retrieves an object associated with the specified name from the current instance.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

用序列化当前 SerializationInfo 所需的数据来填充指定的 LogicalCallContextPopulates a specified SerializationInfo with the data needed to serialize the current LogicalCallContext.

GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
SetData(String, Object) SetData(String, Object) SetData(String, Object) SetData(String, Object)

存储当前实例中的指定对象,并将其与指定名称关联。Stores the specified object in the current instance, and associates it with the specified name.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

安全性

SecurityPermission
用于处理基础结构代码。for operating with infrastructure code. 要求值: LinkDemand;权限值:InfrastructureDemand value: LinkDemand; Permission Value: Infrastructure

适用于