Mono.Enumerations.EnumCheck.Display C# (CSharp) Méthode

Display() public méthode

public Display ( ) : void
Résultat void
		public void Display()
		{
			ecac.ConfigFile = confFile;
			LoadType();
			if(type == null || !type.IsEnum)
			{
				System.Console.Write("-->Failed to load the enumeration: " + className);
				return;
			}
			Array ar = Enum.GetValues(type);
			System.Console.WriteLine("-->Enumeration: {0}", type.ToString());
			for(int i=0; i < ar.Length; i++)
			{
				Enum b = (Enum)ar.GetValue(i);
				System.Console.Write(" {0}", Enum.Format(type, b, "G"));
				System.Console.WriteLine(" ({0}) ", Enum.Format(type, b, "D"));
			}
		}

Usage Example

Exemple #1
0
        public static void Main(string[] args)
        {
            if (args.Length > 0 && (args[0] == "--help" || args[0] == "-h"))
            {
                PrintUsage();
                return;
            }
            EnumCheck check = null;
            string    bdir;

            System.Console.Write("Enter assembly configuration file [{0}]:", confFile);
            //System.Console.Write("[{0}]: ", confFile);
            bdir = System.Console.ReadLine();
            while (bdir.EndsWith("/") || bdir.EndsWith("\\"))
            {
                bdir = bdir.Substring(0, bdir.Length - 1);
            }
            if (bdir != "")
            {
                confFile = bdir;
            }
            if (args.Length != 0)
            {
                foreach (string clName in args)
                {
                    check = new EnumCheck(clName);
                    check.Display();
                    System.Console.WriteLine("\n");
                }
            }
            while (true)
            {
                System.Console.Write("Enter the name of the Enumeration (end to stop): ");
                string clName = System.Console.ReadLine();
                if (clName == "stop" || clName == "end" || clName.Length == 0)
                {
                    break;
                }
                check = new EnumCheck(clName);
                check.Display();
                System.Console.WriteLine("\n");
            }
        }
All Usage Examples Of Mono.Enumerations.EnumCheck::Display