Ejemplo n.º 1
0
        static int Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MainForm form = new MainForm();

            bool nogui = false;

            for (int i = 0; i < args.Length; i++)
            {
                string arg     = args[i];
                string nextArg = (i + 1 < args.Length) ? args[i + 1] : null;

                switch (arg.ToLower())
                {
                case "--nogui":
                case "-nogui":
                    nogui = true;
                    break;

                case "--out":
                case "-out":
                    // if !full path, use report dir
                    form.ReportFileName = nextArg;
                    i++;
                    break;

                default:
                    if (arg.StartsWith("-"))
                    {
                        Console.WriteLine("Unknown argument: {0}", arg);
                        return(1);
                    }

                    form.AddAssembly(arg);
                    break;
                }
            }

            if (!nogui)
            {
                Application.Run(form);
            }
            else
            {
                form.AnalyzeNoGui();
            }

            return(0);
        }
Ejemplo n.º 2
0
 private static void AddAssemblies(MainForm form, string arg)
 {
     try {
         FileAttributes att = File.GetAttributes (arg);
         if ((att & FileAttributes.Directory) == FileAttributes.Directory) {
             Console.WriteLine ("Searching for assemblies in: " + arg);
             form.ScanForAssemblies (arg);
         }
         else {
             form.AddAssembly (arg);
         }
     }
     catch (Exception ex) {
         Console.WriteLine (ex.ToString ());
     }
 }
Ejemplo n.º 3
0
 private static void AddAssemblies(MainForm form, string arg)
 {
     try {
         FileAttributes att = File.GetAttributes(arg);
         if ((att & FileAttributes.Directory) == FileAttributes.Directory)
         {
             Console.WriteLine("Searching for assemblies in: " + arg);
             form.ScanForAssemblies(arg);
         }
         else
         {
             form.AddAssembly(arg);
         }
     }
     catch (Exception ex) {
         Console.WriteLine(ex.ToString());
     }
 }
Ejemplo n.º 4
0
        static int Main(string[] args)
        {
            Application.EnableVisualStyles ();
            Application.SetCompatibleTextRenderingDefault (false);
            MainForm form = new MainForm ();

            bool nogui = false;

            for (int i = 0; i < args.Length; i++) {
                string arg = args[i];
                string nextArg = (i + 1 < args.Length) ? args[i + 1] : null;

                switch (arg.ToLower ()) {
                    case "--nogui":
                    case "-nogui":
                        nogui = true;
                        break;
                    case "--out":
                    case "-out":
                        // if !full path, use report dir
                        form.ReportFileName = nextArg;
                        i++;
                        break;
                    default:
                        if (arg.StartsWith ("-")) {
                            Console.WriteLine ("Unknown argument: {0}", arg);
                            return 1;
                        }

                        form.AddAssembly (arg);
                        break;
                }
            }

            if (!nogui)
                Application.Run (form);
            else
                form.AnalyzeNoGui ();

            return 0;
        }