public PrevensomewareScheduler() { InitializeComponent(); _windowsRegistryManager = new WindowsRegistryManager(); _fileManager = new FileManager(); _appStartupConfigurator = new AppStartupConfigurator(); _boLog = new BoLog(); _serviceInfo = new BoServiceInfo(); }
public MainWindow() { _fileManager = new FileManager(); _windowsRegistryManager = new WindowsRegistryManager(); _boFileInfo = new BoFileInfo(); _windowsServiceManager = new WindowsServiceManager(); _boUserSettings = new BoUserSettings(); var args = Environment.GetCommandLineArgs(); if (args.Length > 1) { ProcessCommandFromWindowsContextMenu(args[1]); } InitializeComponent(); _fileManager.LogDelegate = LogChanges; _windowsRegistryManager.LogDelegate = LogChanges; _appConfigurator.LogDelegate = LogChanges; _windowsServiceManager.LogDelegate = LogChanges; AutoUpdater.Start("http://seekurity.com/Appcast.xml"); var backgroundWorker = new BackgroundWorker(); SetAllButtonsEnabledState(false); _timerTxtServiceUpdater = new Timer { Interval = 60000 }; _timerTxtServiceUpdater.Tick += _timerTxtServiceUpdater_Tick; _timerTxtServiceUpdater.Enabled = true; backgroundWorker.DoWork += (s, eventArgs) => { _appConfigurator.TestAppOnStartUp(); LoadUserSettingsInfo(); logList = new ObservableCollection <DtoLog>(_boLog.GetList()); Dispatcher.Invoke(new Action(() => dataGridLogs.ItemsSource = logList)); }; backgroundWorker.RunWorkerAsync(); }