AssemblyAnalyzer.AssemblyAnalyzer.PrintTypes C# (CSharp) Method

PrintTypes() public method

public PrintTypes ( Types typesToPrint, bool includeMethods ) : void
typesToPrint Types
includeMethods bool
return void
        public void PrintTypes(Types typesToPrint, bool includeMethods)
        {
            var types = a.GetTypes();

            foreach (var type in types)
            {
                switch (typesToPrint)
                {
                    case Types.Any:
                        Console.Out.WriteLine(type.ToString());
                        break;
                    case Types.Interface:
                        if (type.IsInterface) Console.Out.WriteLine(type.ToString());
                        break;
                    case Types.Class:
                        if (type.IsClass) Console.Out.WriteLine(type.ToString());
                        break;
                }
                if (includeMethods)
                {
                    foreach (var methtype in type.GetMethods())
                    {
                        Console.Out.WriteLine("    "+methtype.ToString());
                    }
                }

            }
        }

Usage Example

Example #1
0
 static void Main(string[] args)
 {
     var a = new AssemblyAnalyzer("PersonAdminLib.dll");
     a.PrintTypes(AssemblyAnalyzer.Types.Any, true);
 }