Table of Contents

Method ParseWithTypeConverter

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

ParseWithTypeConverter<T>(string?, ITypeDescriptorContext?, CultureInfo?, bool)

Parses the string representation of an object using TypeConverter registered for the T type.

public static T? ParseWithTypeConverter<T>(string? text, ITypeDescriptorContext? context = null, CultureInfo? culture = null, bool useInvariantCulture = true)

Parameters

text string

The string to parse.

context ITypeDescriptorContext

ITypeDescriptorContext value which is used when text is converted.

culture CultureInfo

CultureInfo value which is used when text is converted.

useInvariantCulture bool

Whether to use TypeConverter with invariant string to value conversion.

Returns

T

Object parsed from the string or Null.

Type Parameters

T

Type of the object to parse from the string.

ParseWithTypeConverter(string?, TypeConverter?, ITypeDescriptorContext?, CultureInfo?, bool)

Parses the string representation of an object using the specified type converter.

public static object? ParseWithTypeConverter(string? text, TypeConverter? typeConverter = null, ITypeDescriptorContext? context = null, CultureInfo? culture = null, bool useInvariantCulture = true)

Parameters

text string

The string to parse.

typeConverter TypeConverter
context ITypeDescriptorContext

ITypeDescriptorContext value which is used when text is converted.

culture CultureInfo

CultureInfo value which is used when text is converted.

useInvariantCulture bool

Whether to use TypeConverter with invariant string to value conversion.

Returns

object

Object parsed from the string or Null.