SerializationUtilities.TryGetValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
TryGetValue<T>(String, T) |
Try to convert a string into the given type, no exception is thrown. |
TryGetValue<T>(SerializationContext, String, T) |
Try to convert a string into the given type, no exception is thrown. |
TryGetValue<T>(String, T)
Try to convert a string into the given type, no exception is thrown.
public:
generic <typename T>
static bool TryGetValue(System::String ^ input, [Runtime::InteropServices::Out] T % result);
public static bool TryGetValue<T> (string input, out T result);
static member TryGetValue : string * 'T -> bool
Public Shared Function TryGetValue(Of T) (input As String, ByRef result As T) As Boolean
Type Parameters
- T
Type to convert to.
Parameters
- input
- String
Input string to convert.
- result
- T
Converted result. The value is unspecified if the conversion fails.
Returns
True if conversion succeeds, false otherwise.
Remarks
Changed method behaviour 26 July 07 - now rethrows critical exceptions rather than suppressing them.
Applies to
TryGetValue<T>(SerializationContext, String, T)
Try to convert a string into the given type, no exception is thrown.
public:
generic <typename T>
static bool TryGetValue(Microsoft::VisualStudio::Modeling::SerializationContext ^ serializationContext, System::String ^ input, [Runtime::InteropServices::Out] T % result);
public static bool TryGetValue<T> (Microsoft.VisualStudio.Modeling.SerializationContext serializationContext, string input, out T result);
static member TryGetValue : Microsoft.VisualStudio.Modeling.SerializationContext * string * 'T -> bool
Public Shared Function TryGetValue(Of T) (serializationContext As SerializationContext, input As String, ByRef result As T) As Boolean
Type Parameters
- T
Type to convert to.
Parameters
- serializationContext
- SerializationContext
Contextual information.
- input
- String
Input string to convert.
- result
- T
Converted result. The value is unspecified if the conversion fails.
Returns
True if conversion succeeds, false otherwise.
Remarks
Changed method behaviour 26 July 07 - now rethrows critical exceptions rather than suppressing them.