Exemplo n.º 1
0
        public MainApp()
        {
            Configuration = new Configuration
            {
                Units = new List <ScannerUnit>
                {
                    new ScannerUnit
                    {
                        DirectoryForScan     = @"C:\",
                        DirectoryForTransfer = @"C:\Users\",
                        SearchPattern        = "*.extension"
                    }
                }
            };

            Settings = new SettingsConfig();

            if (File.Exists(SettingsPath))
            {
                Settings = SettingsConfig.GetSettings(SettingsPath);
            }

            if (File.Exists(ConfigPath))
            {
                Configuration = Configuration.GetConfiguration(ConfigPath);
            }

            SettingsConfig.SaveSettings(Settings, SettingsPath);
            Configuration.SaveConfiguration(Configuration, ConfigPath);

            MainExtensions.SetIsRunWhenStartValue(Settings.IsRunWhenComputerStarts);

            _scanner = new DirectoryScanner();
        }
Exemplo n.º 2
0
        public void ApplySettings(SettingsConfig settingsConfig)
        {
            Settings = settingsConfig;

            SettingsConfig.SaveSettings(settingsConfig, SettingsPath);

            MainExtensions.SetIsRunWhenStartValue(settingsConfig.IsRunWhenComputerStarts);
        }
 private void Cancel()
 {
     MainExtensions.Close();
 }