Share via


AddressItem.TryGetDisplayName method (DecodingOptions, DecodingResults, String)

The TryGetDisplayName method tries to get the display name of this AddressItem object and makes available information about the original 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 AddressItem
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

Return value

Type: System.Boolean

Remarks

If 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 defined by RFC 2047.

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

  • The character set 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

AddressItem class

AddressItem members

TryGetDisplayName overload

Microsoft.Exchange.Data.Mime namespace