EnumUtils - Useful functions for Enums in .NET CF

Click here for project page


License

Apache License 2.0

Summary

A small .NET library providing a handful of useful Enum functions which are missing from the .NET Compact Framework (CF.NET).

Key Features

Usage

Take as an example the following VB.NET Enum:

    Enum Season
        Spring
        Summer
        Fall
        Winter
    End Enum
  1. Get Enum names as String array:

    Dim seasonNames = EnumUtils.GetNames(GetType(Season))
    Assert.AreEqual("Fall", seasonNames(2))
    
  2. Get Enum values as Object array:

    Dim seasonValues = EnumUtils.GetValues(GetType(Season))
    Assert.AreEqual(2, seasonValues(2))
    
  3. Get Enum value via its String name:

    Dim fallValue = EnumUtils.GetValueForName(GetType(Season), "Fall")
    Assert.AreEqual(2, fallValue)
    

How to Build

This library and associated unit tests were developed in VS 2008 as Smart Device projects.

Releases


Author:  Marc Siegel <msiegel -at- kdsecure.com>
Copyright: (c) 2010 by KD Secure, LLC
NO WARRANTY, EXPRESS OR IMPLIED.  USE AT-YOUR-OWN-RISK.