Share via


MimeAddressReader.TryGetDisplayName method (DecodingOptions, DecodingResults, String)

The TryGetDisplayName method tries to get the display name of the current address header and makes available information about the encoding of the display name.

Namespace:  Microsoft.Exchange.Data.Mime
Assembly:  Microsoft.Exchange.Data.Common (in Microsoft.Exchange.Data.Common.dll)

Syntax

'Declaration
Public Function TryGetDisplayName ( _
    decodingOptions As DecodingOptions, _
    <OutAttribute> ByRef decodingResults As DecodingResults, _
    <OutAttribute> ByRef displayName As String _
) As Boolean
'Usage
Dim instance As MimeAddressReader
Dim decodingOptions As DecodingOptions
Dim decodingResults As DecodingResults
Dim displayName As String
Dim returnValue As Boolean

returnValue = instance.TryGetDisplayName(decodingOptions, _
    decodingResults, displayName)
public bool TryGetDisplayName(
    DecodingOptions decodingOptions,
    out DecodingResults decodingResults,
    out string displayName
)

Parameters

  • displayName
    Type: System.String

    A string in which to store the display name.

Return value

Type: System.Boolean

Remarks

If DecodingFlags.None is specified, the TryGetDisplayName method treats the display name as ASCII and converts it to Unicode. Otherwise, TryGetDisplayName tries to determine the character set used by applying the following criteria in the order listed:

  • The character set that is defined by RFC 2047.

  • The character set that is defined by the charset parameter of the Content-Type header.

  • The character set that is defined by the decodingOptions parameter that is passed to TryGetDisplayName.

If null was passed for the decodingOptions parameter, TryGetDisplayName uses the DecodingOptions structure passed to the constructor of the MimeDocument constructor.

If the decodingOptions parameter that was passed to the MimeDocument constructor argument was passed as a null reference (Nothing in Visual Basic), TryGetDisplayName assumes that the encoding is UTF8.

See also

Reference

MimeAddressReader structure

MimeAddressReader members

TryGetDisplayName overload

Microsoft.Exchange.Data.Mime namespace