String Enum

Is this a dirty hack or what? Implementing a class to replicate a string enumeration (as by-design enum is numeric only):

public class RegLibUDFs
{
	public static string CodeName 	= "AC";
	public static string Version 	= "AV";
	public static string Users 		= "AU";
	public static string CompanyDB 	= "AB";
	public static string LicenseKey 	= "AL";
	public static string InstallDate 	= "AI";
}

And now have access to the class-enum, like RegLibUDFs.InstallDate etc.

Leave a Reply

Your email address will not be published. Required fields are marked *