EnumHelper Value Method MVC+ (Model-Facade-View-Controller) Framework for ASP.NET
Gets the string value of an enumeration type

Namespace: NovaDimension.Component
Assembly: NovaDimension.Component (in NovaDimension.Component.dll) Version: 4.0.209.0 (4.0.0209.0)
Syntax

public static string Value(
	Enum pEnum
)

Return Value

Type: String
string value of the enumeration type
Exceptions

Examples

This sample shows how to use the Value(Enum) static method.
using System;
using NovaDimension.Component;

public enum MyEnum
{
    [EnumStringValue("invalid")]
    INVALID,
    [EnumStringValue("resource\\")]
    PATH,
    [EnumStringValue("myresource.jpg")]
    FILENAME
};

class TestClass()
{
    static int Main()
    {
        try {
            Enum pEnum = MyEnum.FILENAME;
            String val = EnumHelper.Value(pEnum); // val = "myresource.jpg"
        }
        catch (ExceptionEx<EnumHelperException> ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
}
See Also