Ejemplo n.º 1
0
        public MainWindow(ExtractorConfig config)
        {
            this.Config = config;

            InitializeComponent();

            this.textInputs.Text = string.Join(Environment.NewLine, this.Config.InputPaths);
            this.textExtensions.Text = string.Join(Environment.NewLine, this.Config.Extensions);
            this.textOutput.Text = this.Config.Output;
            this.textRegexes.Text = string.Join(Environment.NewLine, this.Config.Regexes);
            this.textUsername.Text = this.Config.Username;
            this.textPassword.Text = this.Config.Password;
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Logger.Setup("Error.log");

            try
            {
                ExtractorConfig config;
                bool showUI;

                if (File.Exists(ExtractorConfig.DefualtConfigPath))
                {
                    config = new ExtractorConfig(ExtractorConfig.DefualtConfigPath);
                    showUI = !args.Contains("-q");
                }
                else
                {
                    config = new ExtractorConfig();
                    showUI = true;
                }

                if (showUI)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);

                    MainWindow window = new MainWindow(config);
                    DialogResult result = window.ShowDialog();
                    if (result != DialogResult.OK)
                    {
                        return;
                    }

                    config.Save(ExtractorConfig.DefualtConfigPath);
                }

                Processor processor = new Processor(config);
                processor.Process();

                Thread.Sleep(3000);
            }
            catch (Exception ex)
            {
                Logger.Log(ex.ToString());
            }
            finally
            {
                Logger.Teardown();
            }
        }