Exemple #1
0
        public void Initialize()
        {
            if (CheckIfPortableMode(appSettingsFileName))
            {
                appSettings     = LoadSettings <AppSettings>(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, appSettingsFileName));
                queueSettings   = LoadSettings <QueueSettings>(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, queueSettingsFileName));
                managerSettings = LoadSettings <ManagerSettings>(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, managerSettingsFileName));
            }
            else
            {
                appSettings     = LoadSettings <AppSettings>(Path.Combine(environmentService.AppSettingsPath, appSettingsFileName));
                queueSettings   = LoadSettings <QueueSettings>(Path.Combine(environmentService.AppSettingsPath, queueSettingsFileName));
                managerSettings = LoadSettings <ManagerSettings>(Path.Combine(environmentService.AppSettingsPath, managerSettingsFileName));
            }

            ShellService.Settings                = appSettings;
            ShellService.ShowErrorAction         = ShellViewModel.ShowError;
            ShellService.ShowDetailsViewAction   = ShowDetailsView;
            ShellService.ShowQueueViewAction     = ShowQueueView;
            ShellService.UpdateDetailsViewAction = UpdateDetailsView;
            ShellService.InitializeOAuthManager();

            ManagerController.QueueManager                = queueManager;
            ManagerController.ManagerSettings             = managerSettings;
            ManagerController.BlogManagerFinishedLoading += OnBlogManagerFinishedLoading;
            Task managerControllerInit = ManagerController.Initialize();

            QueueController.QueueSettings = queueSettings;
            QueueController.QueueManager  = queueManager;
            QueueController.Initialize();
            DetailsController.QueueManager = queueManager;
            DetailsController.Initialize();
            CrawlerController.QueueManager = queueManager;
            CrawlerController.Initialize();
        }
Exemple #2
0
        public void Initialize()
        {
            appSettings     = LoadSettings <AppSettings>(appSettingsFileName);
            queueSettings   = LoadSettings <QueueSettings>(queueSettingsFileName);
            managerSettings = LoadSettings <ManagerSettings>(managerSettingsFileName);

            ShellService.Settings              = appSettings;
            ShellService.ShowErrorAction       = ShellViewModel.ShowError;
            ShellService.ShowDetailsViewAction = ShowDetailsView;
            ShellService.ShowQueueViewAction   = ShowQueueView;
            ShellService.InitializeOAuthManager();

            ManagerController.QueueManager                = queueManager;
            ManagerController.ManagerSettings             = managerSettings;
            ManagerController.BlogManagerFinishedLoading += OnBlogManagerFinishedLoading;
            Task managerControllerInit = ManagerController.Initialize();

            QueueController.QueueSettings = queueSettings;
            QueueController.QueueManager  = queueManager;
            QueueController.Initialize();
            DetailsController.QueueManager = queueManager;
            DetailsController.Initialize();
            CrawlerController.QueueManager = queueManager;
            CrawlerController.Initialize();
        }
Exemple #3
0
        public void Shutdown()
        {
            DetailsController.Shutdown();
            QueueController.Shutdown();
            ManagerController.Shutdown();

            SaveSettings(appSettingsFileName, appSettings);
            SaveSettings(queueSettingsFileName, queueSettings);
            SaveSettings(managerSettingsFileName, managerSettings);
        }
Exemple #4
0
        public void Shutdown()
        {
            DetailsController.Shutdown();
            QueueController.Shutdown();
            ManagerController.Shutdown();
            CrawlerController.Shutdown();

            if (appSettings.PortableMode)
            {
                SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, appSettingsFileName), appSettings);
                SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, queueSettingsFileName), queueSettings);
                SaveSettings(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, managerSettingsFileName), managerSettings);
            }
            else
            {
                SaveSettings(Path.Combine(environmentService.AppSettingsPath, appSettingsFileName), appSettings);
                SaveSettings(Path.Combine(environmentService.AppSettingsPath, queueSettingsFileName), queueSettings);
                SaveSettings(Path.Combine(environmentService.AppSettingsPath, managerSettingsFileName), managerSettings);
            }
        }