OpenNETCF Smart Device Framework 2.3
Converts the specified value of a specified enumerated type to its equivalent string representation according to the specified format.

Namespace:  OpenNETCF
Assembly:  OpenNETCF (in OpenNETCF.dll) Version: 2.3.0.0

Syntax

C#
public static string Format(
	Type enumType,
	Object value,
	string format
)
Visual Basic (Declaration)
Public Shared Function Format ( _
	enumType As Type, _
	value As Object, _
	format As String _
) As String
Visual Basic (Usage)
Dim enumType As Type
Dim value As Object
Dim format As String
Dim returnValue As String

returnValue = Enum2.Format(enumType, _
	value, format)
Visual C++
public:
static String^ Format(
	Type^ enumType, 
	Object^ value, 
	String^ format
)
J#
public static String Format(
	Type enumType,
	Object value,
	String format
)
JScript
public static function Format(
	enumType : Type, 
	value : Object, 
	format : String
) : String
JavaScript
OpenNETCF.Enum2.Format = function(enumType, value, format);

Parameters

enumType
Type: System..::.Type
The enumeration type of the value to convert.
value
Type: System..::.Object
The value to convert.
format
Type: System..::.String
The output format to use.

Return Value

A string representation of value.

Remarks

The valid format values are: "G" or "g" - If value is equal to a named enumerated constant, the name of that constant is returned; otherwise, the decimal equivalent of value is returned. For example, suppose the only enumerated constant is named, Red, and its value is 1. If value is specified as 1, then this format returns "Red". However, if value is specified as 2, this format returns "2". "X" or "x" - Represents value in hexadecimal without a leading "0x". "D" or "d" - Represents value in decimal form. "F" or "f" - Behaves identically to "G" or "g", except the FlagsAttribute is not required to be present on the Enum declaration. "V" or "v" - If value is equal to a named enumerated constant, the value of that constant is returned; otherwise, the decimal equivalent of value is returned.

See Also