[Mono-list] Enum :: Real Values

Gaurav Vaish gvaish@iitk.ac.in
Mon, 7 Jan 2002 11:38:08 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C1976F.C79A0B50
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit

Hello,
    I don't recall where, but there's a MonoTODO attribute on an Enum asking to
check for real values of the enumeration members.
    I am attaching the program that I used to get the values. Hope it's useful.



Cheers,
Gaurav Vaish
http://mastergaurav.virtualave.net
http://calendar.yahoo.com/mastergaurav
---------------------------------


------=_NextPart_000_0009_01C1976F.C79A0B50
Content-Type: application/octet-stream;
	name="enumTest.cs"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="enumTest.cs"

/**
 * Namespace: System.Web
 * Class:     enumTest
 *
 * Author:  Gaurav Vaish
 * Contact: <gvaish@iitk.ac.in>
 * Status:  100%
 *
 * (C) Gaurav Vaish (2001)
 */

using System;
using System.IO;
using System.Xml;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Caching;
using System.Security.Permissions;
using System.Security;

namespace com.mastergaurav.Utils
{
	public class enumTest
	{
		public static void Main()
		{
			Type t = typeof(UnitType);
			Array ar = Enum.GetValues(t);
			System.Console.WriteLine("Enumeration: {0}", t.ToString());
			foreach(UnitType b in ar)
			{
				System.Console.Write("String: {0}", Enum.Format(t, b, "G"));
				System.Console.WriteLine(" ({0}) ", Enum.Format(t, b, "D"));
			}
		}
	}
}

------=_NextPart_000_0009_01C1976F.C79A0B50--