LogicalCallContext 類別

定義

在遠端方法呼叫期間提供一組附隨於執行程式碼路徑的屬性。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
繼承
LogicalCallContext
屬性
實作

備註

類別是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

取得值,指出目前的 LogicalCallContext 是否含有資訊。Gets a value indicating whether the current LogicalCallContext contains information.

方法

Clone()

建立目前執行個體複本的新物件。Creates a new object that is a copy of the current instance.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
FreeNamedDataSlot(String)

以指定的名稱清除資料位置。Empties a data slot with the specified name.

GetData(String)

從目前執行個體擷取具有指定名稱的物件。Retrieves an object associated with the specified name from the current instance.

GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetObjectData(SerializationInfo, StreamingContext)

以序列化目前 SerializationInfo 所需資料填入 (Populate) 指定的 LogicalCallContextPopulates a specified SerializationInfo with the data needed to serialize the current LogicalCallContext.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SetData(String, Object)

在目前執行個體中存放指定物件,並使它與指定名稱產生關聯。Stores the specified object in the current instance, and associates it with the specified name.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

安全性

SecurityPermission
用於操作基礎結構程式碼。for operating with infrastructure code. 需求值: LinkDemand;許可權值:InfrastructureDemand value: LinkDemand; Permission Value: Infrastructure

適用於