FontUnit.ToString Method

Definition

FontUnit 对象转换为字符串表示形式。Converts the FontUnit object to a string representation.

Overloads

ToString()

FontUnit 对象转换为默认的字符串表示形式。Converts the FontUnit object to the default string representation.

ToString(CultureInfo)

使用指定的 FontUnitCultureInfo 对象转换为字符串表示形式。Converts the FontUnit object to a string representation, using the specified CultureInfo.

ToString(IFormatProvider)

使用指定的格式提供程序将一个 FontUnit 对象转换为字符串等效项。Converts a FontUnit object to a string equivalent using the specified format provider.

ToString()

FontUnit 对象转换为默认的字符串表示形式。Converts the FontUnit object to the default string representation.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Returns

String

FontUnit 对象的字符串表示形式。The string representation of the FontUnit object.

Remarks

使用 ToString 方法检索 FontUnit的字符串表示形式。Use the ToString method to retrieve the string representation of the FontUnit. 如果 Type 属性设置为 FontSize.AsUnit,则返回的字符串是 Unit 属性中包含的 Unit 的字符串等效项。If the Type property is set to FontSize.AsUnit, the returned string is the string equivalent of the Unit contained in the Unit property. 如果 Type 属性设置为任何其他 FontSize 值,则返回的字符串是 FontSize 值的等效字符串。If the Type property is set to any other FontSize value, the returned string is the string equivalent of the FontSize value.

See also

ToString(CultureInfo)

使用指定的 FontUnitCultureInfo 对象转换为字符串表示形式。Converts the FontUnit object to a string representation, using the specified CultureInfo.

public:
 System::String ^ ToString(System::Globalization::CultureInfo ^ culture);
public string ToString (System.Globalization.CultureInfo culture);
override this.ToString : System.Globalization.CultureInfo -> string
Public Function ToString (culture As CultureInfo) As String

Parameters

culture
CultureInfo

包含要表示 CultureInfo 的区域性的 FontUnitA CultureInfo that contains the culture to represent the FontUnit.

Returns

String

指定区域性中的 FontUnit 对象的字符串表示形式。The string representation of the FontUnit object in the specified culture.

Remarks

使用 ToString 方法可以检索指定区域性中 FontUnit 的字符串表示形式。Use the ToString method to retrieve the string representation of the FontUnit in the specified culture. 如果 Type 属性设置为 FontSize.AsUnit,则返回的字符串是 Unit 属性中包含的 Unit 的字符串等效项。If the Type property is set to FontSize.AsUnit, the returned string is the string equivalent of the Unit contained in the Unit property. 如果 Type 属性设置为任何其他 FontSize 值,则返回的字符串是 FontSize 值的等效字符串。If the Type property is set to any other FontSize value, the returned string is the string equivalent of the FontSize value.

See also

ToString(IFormatProvider)

使用指定的格式提供程序将一个 FontUnit 对象转换为字符串等效项。Converts a FontUnit object to a string equivalent using the specified format provider.

public:
 System::String ^ ToString(IFormatProvider ^ formatProvider);
public string ToString (IFormatProvider formatProvider);
override this.ToString : IFormatProvider -> string
Public Function ToString (formatProvider As IFormatProvider) As String

Parameters

formatProvider
IFormatProvider

一个 IFormatProvider,提供区域性特定格式设置信息,此信息用于 Type 属性设置为 AsUnit 值的情况;否则,它会被忽略。An IFormatProvider that supplies culture-specific formatting information, which is used if the Type property is set to the AsUnit value; otherwise, it is ignored.

Returns

String

表示此 FontUnit 的字符串,其中任何数字单位值都具有 formatProvider 指定的格式。A string that represents this FontUnit, with any numeric unit value in the format specified by formatProvider.

Remarks

使用 ToString 方法检索 FontUnit 对象的字符串表示形式,该对象对字符串中的任何数值使用特定于区域性的格式提供程序。Use the ToString method to retrieve the string representation of the FontUnit object using a culture-specific format provider for any numeric values that are in the string.

如果 Type 属性设置为 AsUnit 值,则返回的字符串与 Unit 属性中包含的单位值等效。If the Type property is set to the AsUnit value, the returned string is the string equivalent of the unit value that is contained in the Unit property. 使用指定的 formatProvider格式化 Unit 值的数字部分。The numeric portion of the Unit value is formatted using the specified formatProvider. 换言之,当 Type 属性设置为 AsUnit 值时,将使用存储在 Unit 属性中的 unit 对象上的 Unit.ToString(IFormatProvider) 方法生成返回的字符串表示形式。In other words, when the Type property is set to the AsUnit value, the returned string representation is generated using the Unit.ToString(IFormatProvider) method on the unit object that is stored in the Unit property.

如果 Type 属性设置为任何其他 FontSize 值,则返回的字符串是 FontSize 值的等效字符串。If the Type property is set to any other FontSize value, the returned string is the string equivalent of the FontSize value.

See also

Applies to