Beispiel #1
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 ());
     }
 }
Beispiel #2
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;
        }
Beispiel #3
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 "--help":
                    case "-help":
                        ShowHelp ();
                        return 0;
                    case "--nogui":
                    case "-nogui":
                        nogui = true;
                        break;
                    case "--ignore":
                    case "-ignore":
                        form.AssembliesToIgnore = nextArg;
                        i++;
                        break;
                    case "--out":
                    case "-out":
                        // if !full path, use report dir
                        if (CheckPath (nextArg)) {
                            form.ReportFileName = nextArg;
                        }
                        else {
                            Console.WriteLine ("Need path definition for '-out', try '-out .\\" + nextArg + "' to use current directory.");
                        }
                        i++;
                        break;
                    case "--xml":
                    case "-xml":
                        if (CheckPath (nextArg)) {
                            form.SubmitFileName = nextArg;
                        }
                        else {
                            Console.WriteLine ("Need path definition for '-xml', try '-xml .\\" + nextArg + "' to use current directory.");
                        }
                        i++;
                        break;
                    default:
                        if (arg.StartsWith ("-")) {
                            Console.WriteLine ("Unknown argument: {0}", arg);
                            return 1;
                        }
                        AddAssemblies (form, arg);
                        break;
                }
            }

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