Esempio n. 1
0
        static void Main(string[] args)
        {
            AssemblyAnalayzer analayzer = new AssemblyAnalayzer();

            analayzer.AssemblyChecker(Assembly.GetExecutingAssembly());

            analayzer.AssemblyChecker(typeof(string).Assembly);
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     try
     {
         Console.WriteLine(AssemblyAnalayzer.AnalayzeAssembly(Assembly.GetExecutingAssembly())? "all approved":"not all approved");
     }
     catch (ArgumentNullException ex)
     {
         Console.WriteLine("you cant send null to tne method");
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Call the methods from the Main method, passing current assembly
        ///  pass a reference to some other Assembly to the AnalyzeAssembly method
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            var otherAssembly       = typeof(string).Assembly;
            var myAssembly          = Assembly.GetExecutingAssembly();
            var myAssemblyAnalayzer = new AssemblyAnalayzer();

            Assembly[] asembliesForAnalaize = { myAssembly, otherAssembly };
            foreach (var asm in asembliesForAnalaize)
            {
                Console.WriteLine($"we run the AnalayzeAssembly method on the asemblly {asm.ToString()} \n");
                if (myAssemblyAnalayzer.AnalayzeAssembly(asm))
                {
                    Console.WriteLine("all the attributed types in the assembly we get was approved");
                }
                else
                {
                    Console.WriteLine(" not all the attributed types in the assembly we get was approved");
                }
            }
        }