Share via


MimeParameter.TryGetValue method (DecodingOptions, DecodingResults, String)

The TryGetValue method puts the value of this MimeParameter object into value, but does not throw an exception if the encoding is unsupported.

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

Syntax

'Declaration
Public Function TryGetValue ( _
    decodingOptions As DecodingOptions, _
    <OutAttribute> ByRef decodingResults As DecodingResults, _
    <OutAttribute> ByRef value As String _
) As Boolean
'Usage
Dim instance As MimeParameter
Dim decodingOptions As DecodingOptions
Dim decodingResults As DecodingResults
Dim value As String
Dim returnValue As Boolean

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

Parameters

  • value
    Type: System.String

    A string in which to store the display name.

Return value

Type: System.Boolean

Remarks

If None is specified, the TryGetValue method treats the display name as ASCII and converts it to Unicode. Otherwise, TryGetValue 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 TryGetValue.

If null was passed for the decodingOptions parameter, TryGetValue uses the DecodingOptions structure that is 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), TryGetValue assumes that the encoding is UTF8.

See also

Reference

MimeParameter class

MimeParameter members

TryGetValue overload

Microsoft.Exchange.Data.Mime namespace