Example #1
0
        private static void Main(string[] args)
        {
            CLIOptions options = new CLIOptions();

            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                if (options.RunBatchProcessing)
                {
                    if (string.IsNullOrEmpty(options.TargetDirectory) || options.ManifestType == EManifestType.Unknown)
                    {
                        Console.Write(options.GetUsage());
                    }

                    // At this point, the options should be valid. Run batch processing.
                    if (Directory.Exists(options.TargetDirectory))
                    {
                        Log.Info("Generating manifest...");

                        ManifestGenerationHandler manifestGenerationHandler = new ManifestGenerationHandler();

                        manifestGenerationHandler.ManifestGenerationProgressChanged += OnProgressChanged;
                        manifestGenerationHandler.ManifestGenerationFinished        += OnGenerationFinished;

                        manifestGenerationHandler.GenerateManifest(options.TargetDirectory, options.ManifestType);
                    }
                    else
                    {
                        Log.Error("The selected directory did not exist.");
                    }
                }
                else if (string.IsNullOrEmpty(options.TargetDirectory) && options.ManifestType == EManifestType.Unknown)
                {
                    // Run a GTK UI instead of batch processing
                    Application.Init();

                    MainWindow win = new MainWindow();
                    win.Show();
                    Application.Run();
                }
                else
                {
                    Console.Write(options.GetUsage());
                }
            }
        }
        static void Main(string[] args)
        {
            options = new CLIOptions();

            if (args != null)
            {
                if (!Parser.Default.ParseArguments(args, options))
                {
                    throw new ArgumentException($@"Cannot parse the arguments. Possible usages: {options.GetUsage()}");
                }
            }

            (new MainFloydWarshallParcs()).RunModule(options);
        }