ContextMessageProperty.TryGet 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試從指定訊息或訊息屬性集合取得 ContextMessageProperty。
多載
| TryGet(Message, ContextMessageProperty) |
嘗試從指定訊息的屬性取得 |
| TryGet(MessageProperties, ContextMessageProperty) |
嘗試從指定的訊息屬性集合取得 |
TryGet(Message, ContextMessageProperty)
嘗試從指定訊息的屬性取得 ContextMessageProperty。
public:
static bool TryGet(System::ServiceModel::Channels::Message ^ message, [Runtime::InteropServices::Out] System::ServiceModel::Channels::ContextMessageProperty ^ % contextMessageProperty);
public static bool TryGet(System.ServiceModel.Channels.Message message, out System.ServiceModel.Channels.ContextMessageProperty contextMessageProperty);
static member TryGet : System.ServiceModel.Channels.Message * ContextMessageProperty -> bool
Public Shared Function TryGet (message As Message, ByRef contextMessageProperty As ContextMessageProperty) As Boolean
參數
- contextMessageProperty
- ContextMessageProperty
當這個方法傳回 true 時,contextMessageProperty 包含一個 ContextMessageProperty,而後者又包含與 ContextMessageProperty 關聯的 message。 這個參數會以未初始化的狀態傳遞。
傳回
當 true 的值是從 ContextMessageProperty 取得,則為 message;否則為 false。
適用於
TryGet(MessageProperties, ContextMessageProperty)
嘗試從指定的訊息屬性集合取得 ContextMessageProperty。
public:
static bool TryGet(System::ServiceModel::Channels::MessageProperties ^ properties, [Runtime::InteropServices::Out] System::ServiceModel::Channels::ContextMessageProperty ^ % contextMessageProperty);
public static bool TryGet(System.ServiceModel.Channels.MessageProperties properties, out System.ServiceModel.Channels.ContextMessageProperty contextMessageProperty);
static member TryGet : System.ServiceModel.Channels.MessageProperties * ContextMessageProperty -> bool
Public Shared Function TryGet (properties As MessageProperties, ByRef contextMessageProperty As ContextMessageProperty) As Boolean
參數
- properties
- MessageProperties
MessageProperties,會從此處擷取內容訊息屬性。
- contextMessageProperty
- ContextMessageProperty
當這個方法傳回 true 時,contextMessageProperty 包含一個 ContextMessageProperty,而後者又包含與 ContextMessageProperty 關聯的 properties。 這個參數會以未初始化的狀態傳遞。
傳回
當 true 的值是從 ContextMessageProperty 取得,則為 properties;否則為 false。