IsContentTypeSupported Method
Collapse the table of content
Expand the table of content

MessageEncoder.IsContentTypeSupported Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns a value that indicates whether a specified message-level content-type value is supported by the message encoder.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

'Declaration
Public Overridable Function IsContentTypeSupported ( _
	contentType As String _
) As Boolean

Parameters

contentType
Type: System.String
The message-level content-type being tested.

Return Value

Type: System.Boolean
true if the message-level content-type specified is supported; otherwise false.

This method is used to determine whether the message encoder can be used to read a particular style of message, based on its content-type.

A grammar that details the syntax of the content-type header is described in RFC 2045 Section 5.1. RFC 2046 provides detailed information about Multipurpose Internet Mail Extensions (MIME) media types and their parameters.

The following code example shows how to override this method to handle different content types with the same media type.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft