public ActivationService(App app, Type defaultNavItem, Lazy <UIElement> shell = null)
 {
     _app                   = app;
     _shell                 = shell;
     _defaultNavItem        = defaultNavItem;
     _backgroundTaskService = ServiceLocator.Current.GetInstance <IBackgroundTaskService>();
 }
 public SaveDirectoryEntryCommand(IPromptService promptService, IServiceProvider serviceProvider, IBackgroundTaskService backgroundTaskService, ILoggerFactory loggerFactory)
 {
     _logger                = (loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory))).CreateLogger(this.GetType());
     _promptService         = promptService ?? throw new ArgumentNullException(nameof(promptService));
     _serviceProvider       = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _backgroundTaskService = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
 }
Exemplo n.º 3
0
 public FileOpenerService(IOpenedFileService openedFileService, ILoggerFactory loggerFactory, IAppSettings appSettings, IFileLoader fileLoader, IBackgroundTaskService backgroundTaskService)
 {
     _openedFileService     = openedFileService ?? throw new ArgumentNullException(nameof(openedFileService));
     _appSettings           = appSettings ?? throw new ArgumentNullException(nameof(appSettings));
     _fileLoader            = fileLoader ?? throw new ArgumentNullException(nameof(fileLoader));
     _backgroundTaskService = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
     _logger = loggerFactory.CreateLogger(this.GetType());
 }
Exemplo n.º 4
0
        protected override void doWork()
        {
            logService.Debug(DateTime.Now);
            IBackgroundTaskService backgroundTaskService = BackgroundTaskService.GetInstance();

            backgroundTaskService.doWork();
            logService.Debug("CloudflareLogHandleService start.");
        }
Exemplo n.º 5
0
 public UserDatagramService(IApplicationDataService applicationDataService, IBackgroundTaskService backgroundTaskService, ITransmissionControlService transmissionControlService, IEventAggregator eventAggregator, IIotService iotService)
 {
     _applicationDataService     = applicationDataService;
     _backgroundTaskService      = backgroundTaskService;
     _transmissionControlService = transmissionControlService;
     _eventAggregator            = eventAggregator;
     _iotService = iotService;
     _backgroundTaskRegistration = null;
 }
Exemplo n.º 6
0
 public TransmissionControlService(IApplicationDataService applicationDataService, IBackgroundTaskService backgroundTaskService, IEventAggregator eventAggregator, IDatabaseService databaseService, IIotService iotService)
 {
     _applicationDataService     = applicationDataService;
     _backgroundTaskService      = backgroundTaskService;
     _eventAggregator            = eventAggregator;
     _databaseService            = databaseService;
     _iotService                 = iotService;
     _backgroundTaskRegistration = null;
 }
Exemplo n.º 7
0
 public ShellViewModel(INavigationService navigationServiceInstance, IUnityContainer unityContainer)
 {
     _navigationService          = navigationServiceInstance;
     _applicationDataService     = unityContainer.Resolve <IApplicationDataService>();
     _backgroundTaskService      = unityContainer.Resolve <IBackgroundTaskService>();
     _liveTileUpdateService      = unityContainer.Resolve <ILiveTileUpdateService>();
     _userDatagramService        = unityContainer.Resolve <IUserDatagramService>();
     _transmissionControlService = unityContainer.Resolve <ITransmissionControlService>();
     ItemInvokedCommand          = new DelegateCommand <WinUI.NavigationViewItemInvokedEventArgs>(OnItemInvoked);
 }
Exemplo n.º 8
0
        public MainViewModel(IJobService jobService, IBackgroundTaskService backgroundTaskService)
        {
            this.jobService = jobService;
            this.backgroundTaskService = backgroundTaskService;

            if (this.IsInDesignMode)
            {
                this.Jobs = this.jobService.GetListOfJobs();
            }
        }
Exemplo n.º 9
0
 public SettingsViewModel(IBackgroundTaskService backgroundTaskService,
                          IWallpaperService wallpaperService,
                          IHTTPService hTTPService,
                          IIOManager iOManager,
                          IBingHTTPService bingHTTPService)
 {
     _backgroundTaskService = backgroundTaskService ?? throw new System.ArgumentNullException(nameof(backgroundTaskService));
     _wallpaperService      = wallpaperService ?? throw new System.ArgumentNullException(nameof(wallpaperService));
     _hTTPService           = hTTPService ?? throw new System.ArgumentNullException(nameof(hTTPService));
     _iOManager             = iOManager ?? throw new System.ArgumentNullException(nameof(iOManager));
     _bingHTTPService       = bingHTTPService ?? throw new ArgumentNullException(nameof(bingHTTPService));
 }
Exemplo n.º 10
0
        public SpotlightViewModel(IDataService dataService,
                                  IIOManager iOManager,
                                  IHTTPService hTTPService,
                                  IDialogService dialogService,
                                  IBackgroundTaskService backgroundTaskService)
        {
            IsLoaded = false;

            _dataService           = dataService ?? throw new ArgumentNullException(nameof(dataService));
            _iOManager             = iOManager ?? throw new ArgumentNullException(nameof(iOManager));
            _hTTPService           = hTTPService ?? throw new ArgumentNullException(nameof(hTTPService));
            _dialogService         = dialogService ?? throw new ArgumentNullException(nameof(dialogService));
            _backgroundTaskService = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
            _downloadPath          = _iOManager.DownloadPath;
            _templatePath          = _iOManager.TemplatePath;
        }
Exemplo n.º 11
0
        public void Initialize(
            INavigationService navigationService,
            ISqliteConnectionFactory sqliteConnectionFactory,
            IAuthentificationPlatformFactory plaformFactory,
            ICalendarIntegrationService calendarIntegrationService,
            IAlertService alertService,
            IBackgroundTaskService backgroundTaskService)
        {
            NavigationService          = navigationService;
            AlertService               = alertService;
            CalendarIntegrationService = calendarIntegrationService;
            BackgroundTaskService      = backgroundTaskService;

            SimpleIoc.Default.Register <IAuthentificationService>(() => new AuthentificationService(plaformFactory));
            if (_useMock)
            {
                SimpleIoc.Default.Register <IOnlineMeetingRepository>(() => new MyCompanyInThePocket.Core.Repositories.MockRepositories.MeetingRepository());
                SimpleIoc.Default.Register <IOnlineUseFullLinkRepository>(() => new MyCompanyInThePocket.Core.Repositories.MockRepositories.UseFullLinkRepository());
            }
            else
            {
                var authentificationService = SimpleIoc.Default.GetInstanceWithoutCaching <IAuthentificationService>();
                SimpleIoc.Default.Register <IOnlineMeetingRepository>(() => new MyCompanyInThePocket.Core.Repositories.OnlineRepositories.OnlineMeetingRepository(authentificationService));
                SimpleIoc.Default.Register <IOnlineUseFullLinkRepository>(() => new MyCompanyInThePocket.Core.Repositories.MockRepositories.UseFullLinkRepository());
                SimpleIoc.Default.Register <IOnlineUseFullDocumentRepository>(() => new MyCompanyInThePocket.Core.Repositories.OnlineRepositories.OnlineUseFullDocumentRepository(authentificationService));
            }


            SimpleIoc.Default.Register <IDatabaseService>(() => new DatabaseService(sqliteConnectionFactory));

            var databaseService = SimpleIoc.Default.GetInstanceWithoutCaching <IDatabaseService>();


            SimpleIoc.Default.Register <IDbMeetingRepository>(() => new DbMeetingRepository(sqliteConnectionFactory));

            var onlineMeetingRepository     = SimpleIoc.Default.GetInstanceWithoutCaching <IOnlineMeetingRepository>();
            var dbMeetingRepository         = SimpleIoc.Default.GetInstanceWithoutCaching <IDbMeetingRepository>();
            var onlineUseFullLinkRepository = SimpleIoc.Default.GetInstanceWithoutCaching <IOnlineUseFullLinkRepository>();
            var onlineDocumentsRepository   = SimpleIoc.Default.GetInstanceWithoutCaching <IOnlineUseFullDocumentRepository>();

            SimpleIoc.Default.Register <IMeetingService>(() => new MeetingsService(onlineMeetingRepository, dbMeetingRepository));
            SimpleIoc.Default.Register <IUseFullLinkService>(() => new UseFullLinkService(onlineUseFullLinkRepository));
            SimpleIoc.Default.Register <IUseFullDocumentService>(() => new UseFullDocumentService(onlineDocumentsRepository));

            IsInitialized = true;
        }
Exemplo n.º 12
0
        public MainWindowViewModel(
            ILoggerFactory loggerFactory,
            IOpenedFileService openedFileService,
            IOpenFileCommand openFileCommand,
            IOpenLastFileCommand openLastFileCommand,
            ICloseFileCommand closeFileCommand,
            IExitAppCommand exitAppCommand,
            IShowSettingsViewCommand showSettingsViewCommand,
            IVerifyNcasHeaderSignatureCommand verifyNcasHeaderSignatureCommand,
            IVerifyNcasHashCommand verifyNcasHashCommand,
            ILoadKeysCommand loadKeysCommand,
            IOpenTitleWebPageCommand openTitleWebPageCommand,
            IFileOpenerService fileOpenerService,
            IServiceProvider serviceProvider,
            ILogSource logSource,
            IBackgroundTaskService backgroundTaskService)
        {
            _logger                          = (loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory))).CreateLogger(this.GetType());
            _fileOpenerService               = fileOpenerService ?? throw new ArgumentNullException(nameof(fileOpenerService));
            _openedFileService               = openedFileService ?? throw new ArgumentNullException(nameof(openedFileService));
            OpenFileCommand                  = openFileCommand ?? throw new ArgumentNullException(nameof(openFileCommand));
            ExitAppCommand                   = exitAppCommand ?? throw new ArgumentNullException(nameof(exitAppCommand));
            ShowSettingsViewCommand          = showSettingsViewCommand ?? throw new ArgumentNullException(nameof(showSettingsViewCommand));
            VerifyNcasHeaderSignatureCommand = verifyNcasHeaderSignatureCommand ?? throw new ArgumentNullException(nameof(verifyNcasHeaderSignatureCommand));
            VerifyNcasHashCommand            = verifyNcasHashCommand ?? throw new ArgumentNullException(nameof(verifyNcasHashCommand));
            LoadKeysCommand                  = loadKeysCommand ?? throw new ArgumentNullException(nameof(loadKeysCommand));
            ServiceProvider                  = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
            LogSource                        = logSource ?? throw new ArgumentNullException(nameof(logSource));
            BackgroundTask                   = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
            OpenLastFileCommand              = openLastFileCommand ?? throw new ArgumentNullException(nameof(openLastFileCommand));
            CloseFileCommand                 = closeFileCommand ?? throw new ArgumentNullException(nameof(closeFileCommand));
            OpenTitleWebPageCommand          = openTitleWebPageCommand ?? throw new ArgumentNullException(nameof(closeFileCommand));

            var assemblyName    = Assembly.GetExecutingAssembly().GetName();
            var assemblyVersion = (assemblyName.Version ?? new Version());

            _appNameAndVersion = $"{assemblyName.Name} v{assemblyVersion.Major}.{assemblyVersion.Minor}.{assemblyVersion.Revision}";

            UpdateTitle();
            _openedFileService.OpenedFileChanged += OnOpenedFileChanged;
            LogSource.Log += OnLog;

            _animationDurationTimer          = new Timer(3000);
            _animationDurationTimer.Elapsed += OnAnimationDurationTimerElapsed;
        }
Exemplo n.º 13
0
        public VerifyNcasHeaderSignatureCommand(IOpenedFileService openedFileService, IBackgroundTaskService backgroundTaskService, IServiceProvider serviceProvider)
        {
            _openedFileService     = openedFileService ?? throw new ArgumentNullException(nameof(openedFileService));
            _backgroundTaskService = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
            _serviceProvider       = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
            _openedFileService.OpenedFileChanged += (sender, args) =>
            {
                TriggerCanExecuteChanged();
            };

            _backgroundTaskService.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(IBackgroundTaskService.IsRunning))
                {
                    TriggerCanExecuteChanged();
                }
            };
        }
Exemplo n.º 14
0
        public SettingsPageViewModel(
            ILoggingService logging,
            IBackgroundTaskService backgroundTask,
            IPlatformSpecific device,
            SQLiteConnection database)
        {
            _loggingService        = logging;
            _backgroundTaskService = backgroundTask;
            _device   = device;
            _database = database;

            _loggingService.WriteLine($"Creating a new instance of {nameof(SettingsPageViewModel)}.");

            OpenDocumentationCommand          = new RelayCommand(() => _device.LaunchUri(_documentationUri));
            OpenWallabagTwitterAccountCommand = new RelayCommand(() => _device.LaunchUri(_twitterAccountUri));
            ContactDeveloperCommand           = new RelayCommand(() => _device.LaunchUri(_mailUri));
            CreateIssueCommand    = new RelayCommand(() => _device.LaunchUri(_githubIssueUri));
            RateAppCommand        = new RelayCommand(() => _device.LaunchUri(_rateAppUri));
            LogoutCommand         = new RelayCommand(() => Logout());
            DeleteDatabaseCommand = new RelayCommand(() => DeleteDatabase());
        }
Exemplo n.º 15
0
        public DemoServiceLocatorMaster(UserContext context)
            : base(context)
        {
            userService   = new DemoUserService(this);
            schoolService = new DemoSchoolService(this);
            chalkableDepartmentService = new DemoChalkableDepartmentService(this);
            categoryService            = new DemoCategoryService(this);
            developerService           = new DemoDeveloperService(this);
            districtService            = new DemoDistrictService(this);
            emailService             = new DemoEmailService(this);
            backgroundTaskService    = new DemoBackgroundTaskService(this);
            applicationService       = new DemoApplicationService(this);
            applicationUploadService = new DemoApplicationUploadService(this);

            preferenceService         = new PreferenceService(this);
            personPictureService      = new PersonPictureService(this);
            departmentIconService     = new DepartmentIconService(this);
            applicationPictureService = new ApplicationPictureService(this);
            dbService           = new DbService(Context != null ? Context.MasterConnectionString : null);
            userTrackingService = new NullTrackingService();
        }
Exemplo n.º 16
0
 public ServiceLocatorMaster(UserContext context) : base(context)
 {
     userService                     = new UserService(this);
     schoolService                   = new SchoolService(this);
     backgroundTaskService           = new BackgroundTaskService(this);
     preferenceService               = new PreferenceService(this);
     chalkableDepartmentService      = new ChalkableDepartmentService(this);
     personPictureService            = new PersonPictureService(this);
     departmentIconService           = new DepartmentIconService(this);
     customReportTemplateIconService = new CustomReportTemplateIconService(this);
     districtService                 = new DistrictService(this);
     applicationService              = new ApplicationService(this);
     categoryService                 = new CategoryService(this);
     applicationUploadService        = new ApplicationUploadService(this);
     EmailService                    = new EmailService(this);
     developerService                = new DeveloperService(this);
     applicationPictureService       = new ApplicationPictureService(this);
     DbService                   = new DbService(Context?.MasterConnectionString);
     userTrackingService         = new MixPanelService(Settings.MixPanelToken);
     dbMaintenanceService        = new DbMaintenanceService(this);
     academicBenchmarkService    = new AcademicBenchmarkService(this);
     customReportTemplateService = new CustomReportTemplateService(this);
 }
Exemplo n.º 17
0
        public SettingsViewModel()
        {
            _meetingService        = App.Instance.GetInstance <IMeetingService>();
            _authenService         = App.Instance.GetInstance <IAuthentificationService>();
            _backgroundTaskService = App.Instance.BackgroundTaskService;

            //TODO : localisation
            SettingsList = new SuspendableObservableCollection <GroupedSettingsViewModel>();
            SettingsList.Add(new GroupedSettingsViewModel("ACRA", new List <SettingViewModel>
            {
                new ToggleSettingViewModel("Intégration dans le calendrier", new RelayCommand <bool>(ToggleIntegrationCalendar), ApplicationSettings.IsIntegrationToCalendarEnabled),
                new ToggleSettingViewModel("Intégration dans les rappels", new RelayCommand <bool>(ToggleIsIntegrationReminder), ApplicationSettings.IsIntegrationToReminderEnabled),
                new ToggleSettingViewModel("Mise à jour en arrière-plan", new RelayCommand <bool>(ToggleBackgroundUpdate), ApplicationSettings.IsBackgroundUpdateEnabled),
            }));
            //TODO : localisation
            SettingsList.Add(new GroupedSettingsViewModel(OnlineSettings.Identity, new List <SettingViewModel>
            {
                new ButtonSettingViewModel("Déconnexion", new RelayCommand(LogOutAction))
                {
                    ColorStyle          = ColorStyle.Danger,
                    HorizontalAlignment = SettingsHorizontalAlignment.Center
                }
            }));
        }
 public BackgroundTasksStarter(IBackgroundTaskService backgroundService)
 {
     _backgroundService = backgroundService;
 }
Exemplo n.º 19
0
 public TasksPage()
 {
     InitializeComponent();
     _backgroundTaskService = Injector.Get <IBackgroundTaskService>();
     _dialogService         = Injector.Get <IDialogService>();
 }
Exemplo n.º 20
0
 public void Init(EntityApp app)
 {
     _app         = app;
     _taskService = app.GetService <IBackgroundTaskService>();
 }
Exemplo n.º 21
0
 public BackgroundTasksStarter(IBackgroundTaskService backgroundService)
 {
     _backgroundService = backgroundService;
 }
        public SettingsWindowViewModel(
            IAppSettingsManager appSettingsManager,
            IBackgroundTaskService backgroundTaskService,
            IServiceProvider serviceProvider,
            IKeySetProviderService keySetProviderService,
            ILoggerFactory loggerFactory)
        {
            _appSettingsManager    = appSettingsManager ?? throw new ArgumentNullException(nameof(appSettingsManager));
            _backgroundTaskService = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
            _serviceProvider       = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
            _keySetProviderService = keySetProviderService ?? throw new ArgumentNullException(nameof(keySetProviderService));
            _logger = (loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory))).CreateLogger(this.GetType());

            _appSettings = appSettingsManager.Settings;

            BrowseProdKeysCommand    = new RelayCommand(BrowseProdKeys);
            BrowseConsoleKeysCommand = new RelayCommand(BrowseConsoleKeys);
            BrowseTitleKeysCommand   = new RelayCommand(BrowseTitleKeys);
            SaveSettingsCommand      = new RelayCommand(SaveSettings);
            CancelSettingsCommand    = new RelayCommand(CancelSettings);
            DownloadProdKeysCommand  = new RelayCommand(DownloadProdKeys, CanDownloadProdKeys);
            DownloadTitleKeysCommand = new RelayCommand(DownloadTitleKeys, CanDownloadTitleKeys);
            EditProdKeysCommand      = new RelayCommand(EditProdKeys, CanEditProdKeys);
            EditTitleKeysCommand     = new RelayCommand(EditTitleKeys, CanEditTitleKeys);
            EditConsoleKeysCommand   = new RelayCommand(EditConsoleKeys, CanEditConsoleKeys);

            ProdKeysFilePath           = _appSettings.ProdKeysFilePath;
            ConsoleKeysFilePath        = _appSettings.ConsoleKeysFilePath;
            TitleKeysFilePath          = _appSettings.TitleKeysFilePath;
            SelectedLogLevel           = _appSettings.LogLevel;
            ProdKeysDownloadUrl        = _appSettings.ProdKeysDownloadUrl;
            TitleKeysDownloadUrl       = _appSettings.TitleKeysDownloadUrl;
            AlwaysReloadKeysBeforeOpen = _appSettings.AlwaysReloadKeysBeforeOpen;
            TitlePageUrl          = _appSettings.TitlePageUrl;
            this.SelectedLanguage = LocalizationManager.Instance.Current;

            _backgroundTaskService.PropertyChanged += (_, args) =>
            {
                if (args.PropertyName == nameof(IBackgroundTaskService.IsRunning))
                {
                    DownloadProdKeysCommand.TriggerCanExecuteChanged();
                    DownloadTitleKeysCommand.TriggerCanExecuteChanged();
                }
            };

            _keySetProviderService.PropertyChanged += (_, args) =>
            {
                if (args.PropertyName == nameof(IKeySetProviderService.ActualProdKeysFilePath))
                {
                    NotifyPropertyChanged(nameof(ActualProdKeysFilePath));
                }
                else if (args.PropertyName == nameof(IKeySetProviderService.ActualTitleKeysFilePath))
                {
                    NotifyPropertyChanged(nameof(ActualTitleKeysFilePath));
                }
                else if (args.PropertyName == nameof(IKeySetProviderService.ActualConsoleKeysFilePath))
                {
                    NotifyPropertyChanged(nameof(ActualConsoleKeysFilePath));
                }
            };
        }
Exemplo n.º 23
0
 public BackgroundTaskScheduler(IApplianceService applianceService, IBackgroundTaskService taskService, IServiceProvider serviceProvider)
 {
     _applianceService = applianceService;
     _taskService      = taskService;
     _serviceProvider  = serviceProvider;
 }
Exemplo n.º 24
0
 public BackgroundTasksController(IBackgroundTaskService backgroundTaskService)
 {
     _backgroundTaskService = backgroundTaskService;
 }