示例#1
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Verify that robocopy is present on the system
            if (!WindowsOps.VerifyRobocopy())
            {
                // Display error message if Robocopy isn't found
                var dlg = new RobocopyDlg();
                dlg.ShowDialog();

                // If the user didn't choose to ignore, close FilExile
                if (dlg.DialogResult != DialogResult.Ignore)
                {
                    Application.Exit();
                    Environment.Exit(1);
                }
            }

            if (args.Length > 0)
            {
                _cla = new CommandLineArgs(args);

                if (_cla.HelpFlag)
                    CommandLineInterface.DisplayHelp();
                else
                    CommandLineInterface.Run(args[0], _cla);
            }
            else
            {
                Application.Run(new Dialogs.Main());
            }
        }
示例#2
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Verify that robocopy is present on the system
            if (!Properties.Settings.Default.disableRobocopyCheck && !WindowsOps.VerifyRobocopy())
            {
                // Display error message if Robocopy isn't found
                var dlg = new RobocopyDlg();
                dlg.ShowDialog();

                // If the user didn't choose to ignore, close FilExile
                if (dlg.DialogResult != DialogResult.Ignore)
                {
                    Application.Exit();
                    Environment.Exit(1);
                }
            }

            try
            {
                // If any command line arguments are passed, prepare them for parsing
                if (args.Length > 0)
                {
                    _cla = new CommandLineArgs(args);
                    AttachConsole(AttachParentProcess);

                    if (_cla.HelpFlag)
                        CommandLineInterface.DisplayHelp();
                    else
                        CommandLineInterface.Run(args[0], _cla);
                }
                // Otherwise, launch the FilExile GUI
                else
                {
                    Application.Run(new Dialogs.Main());
                }
            }

            finally
            {
                FreeConsole();
            }
        }