Example #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();
        }
Example #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();
        }