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。