ContextMessageProperty 類別

定義

此屬性可用來在應用程式與用戶端或服務的通道層級之間進行內容通訊。

public ref class ContextMessageProperty : System::ServiceModel::Channels::IMessageProperty
[System.Serializable]
public class ContextMessageProperty : System.ServiceModel.Channels.IMessageProperty
[<System.Serializable>]
type ContextMessageProperty = class
    interface IMessageProperty
Public Class ContextMessageProperty
Implements IMessageProperty
繼承
ContextMessageProperty
屬性
實作

備註

新增至 Message 的屬性集合,會將組成用戶端與服務間的交談之訊息相互關聯。

Enabledtrue,則會在通道層次建立內容,且用戶端與服務上的所有傳入訊息,都擁有這個由內容通道所附加的內容屬性。 若 Enabledfalse,則會使用 ContextMessageProperty 在應用程式層將內容附加到用戶端或服務的傳出訊息上。

ContextMessageProperty 可用於用戶端或服務上。 或者,在用戶端上,亦可使用 GetContextSetContext 屬性來取得目前內容,或在通道執行個體上設定新的內容 (僅限用戶端)。

建構函式

ContextMessageProperty()

初始化 ContextMessageProperty 類別的新執行個體。

ContextMessageProperty(IDictionary<String,String>)

使用指定的內容,初始化 ContextMessageProperty 類別的新執行個體。

屬性

Context

取得用來將用戶端與服務間交談內的訊息相互關聯之內容。

Name

取得內容訊息屬性的名稱。

方法

AddOrReplaceInMessage(Message)

ContextMessageProperty 的目前執行個體中,設定指定 Message 中的 ContextMessageProperty 屬性之值。

AddOrReplaceInMessageProperties(MessageProperties)

ContextMessageProperty 的目前執行個體中,設定指定 MessageProperties 集合中的 ContextMessageProperty 屬性之值。

CreateCopy()

建立 ContextMessageProperty 的目前執行個體之複本。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
TryCreateFromHttpCookieHeader(String, ContextMessageProperty)

嘗試從指定 HTTP Cookie 的索引鍵/值組,具現化 ContextMessageProperty

TryGet(Message, ContextMessageProperty)

嘗試從指定訊息的屬性取得 ContextMessageProperty

TryGet(MessageProperties, ContextMessageProperty)

嘗試從指定的訊息屬性集合取得 ContextMessageProperty

適用於

另請參閱