System.Web.UI.WebControls.FontUnit.Parse Method

Converts the specified string to its System.Web.UI.WebControls.FontUnit equivalent in the specified culture.

Syntax

public static FontUnit Parse (string s, System.Globalization.CultureInfo culture)

Parameters

s
A string representation of one of the System.Web.UI.WebControls.FontSize values.
culture
A System.Globalization.CultureInfo that represents the culture of the System.Web.UI.WebControls.FontUnit object.

Returns

A System.Web.UI.WebControls.FontUnit that represents the font size specified by the s parameter in the culture specified by the culture parameter.

Remarks

Use the static FontUnit.Parse(string) method to convert the specified string and culture to its System.Web.UI.WebControls.FontUnit equivalent.

If the value of the s parameter is not null, not string.Empty, and a valid System.Web.UI.WebControls.FontSize value, the following table shows initial property values for the new instance of System.Web.UI.WebControls.FontUnit.

Type

The System.Web.UI.WebControls.FontSize enumeration equivalent of the s parameter.

Unit

Unit.Empty

If the value of the s parameter is not null, not string.Empty, and an invalid System.Web.UI.WebControls.FontSize value, the following table shows initial property values for the new instance of System.Web.UI.WebControls.FontUnit.

Type

FontSize.AsUnit

Unit

A System.Web.UI.WebControls.Unit object with its Unit.Value property initialized with the s parameter in the specified culture.

If the value of the s parameter is null or string.Empty, the following table shows initial property values for an instance of System.Web.UI.WebControls.FontUnit.

Type

FontSize.NotSet

Unit

Unit.Empty

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0