示例#1
0
        public RepositoryViewModel(RepositoryDatabase repositoryDatabase,
                                   GitHubAuthenticationService gitHubAuthenticationService,
                                   GitHubGraphQLApiService gitHubGraphQLApiService,
                                   IAnalyticsService analyticsService,
                                   SortingService sortingService,
                                   GitHubApiV3Service gitHubApiV3Service,
                                   NotificationService notificationService,
                                   IMainThread mainThread,
                                   GitHubUserService gitHubUserService) : base(analyticsService, mainThread)
        {
            _repositoryDatabase          = repositoryDatabase;
            _gitHubAuthenticationService = gitHubAuthenticationService;
            _gitHubGraphQLApiService     = gitHubGraphQLApiService;
            _sortingService     = sortingService;
            _gitHubApiV3Service = gitHubApiV3Service;
            _gitHubUserService  = gitHubUserService;

            RefreshState = RefreshState.Uninitialized;

            PullToRefreshCommand      = new AsyncCommand(() => ExecutePullToRefreshCommand(gitHubUserService.Alias));
            FilterRepositoriesCommand = new Command <string>(SetSearchBarText);
            SortRepositoriesCommand   = new Command <SortingOption>(ExecuteSortRepositoriesCommand);

            notificationService.SortingOptionRequested            += HandleSortingOptionRequested;
            gitHubAuthenticationService.LoggedOut                 += HandleGitHubAuthenticationServiceLoggedOut;
            gitHubAuthenticationService.AuthorizeSessionCompleted += HandleAuthorizeSessionCompleted;
            gitHubAuthenticationService.DemoUserActivated         += HandleDemoUserActivated;
        }
 public GitHubAuthenticationService(AzureFunctionsApiService azureFunctionsApiService,
                                    GitHubGraphQLApiService gitHubGraphQLApiService,
                                    RepositoryDatabase repositoryDatabase)
 {
     _azureFunctionsApiService = azureFunctionsApiService;
     _gitHubGraphQLApiService  = gitHubGraphQLApiService;
     _repositoryDatabase       = repositoryDatabase;
 }
示例#3
0
        public RepositoryViewModel(RepositoryDatabase repositoryDatabase,
                                   GitHubAuthenticationService gitHubAuthenticationService,
                                   GitHubGraphQLApiService gitHubGraphQLApiService)
        {
            _repositoryDatabase          = repositoryDatabase;
            _gitHubAuthenticationService = gitHubAuthenticationService;
            _gitHubGraphQLApiService     = gitHubGraphQLApiService;

            PullToRefreshCommand      = new AsyncCommand(() => ExecutePullToRefreshCommand(_gitHubAuthenticationService.Alias));
            FilterRepositoriesCommand = new Command <string>(text => SetSearchBarText(text));
        }
示例#4
0
 public BackgroundFetchService(AnalyticsService analyticsService,
                               GitHubApiV3Service gitHubApiV3Service,
                               GitHubGraphQLApiService gitHubGraphQLApiService,
                               RepositoryDatabase repositoryDatabase,
                               NotificationService notificationService)
 {
     _analyticsService        = analyticsService;
     _gitHubApiV3Service      = gitHubApiV3Service;
     _gitHubGraphQLApiService = gitHubGraphQLApiService;
     _repositoryDatabase      = repositoryDatabase;
     _notificationService     = notificationService;
 }
        public GitHubAuthenticationService(AzureFunctionsApiService azureFunctionsApiService,
                                           GitHubGraphQLApiService gitHubGraphQLApiService,
                                           RepositoryDatabase repositoryDatabase,
                                           AnalyticsService analyticsService)
        {
            _azureFunctionsApiService = azureFunctionsApiService;
            _gitHubGraphQLApiService  = gitHubGraphQLApiService;
            _repositoryDatabase       = repositoryDatabase;
            _analyticsService         = analyticsService;

            ThemeService.PreferenceChanged += HandlePreferenceChanged;
        }
        public GitHubAuthenticationService(AzureFunctionsApiService azureFunctionsApiService,
                                           GitHubGraphQLApiService gitHubGraphQLApiService,
                                           RepositoryDatabase repositoryDatabase,
                                           IAnalyticsService analyticsService,
                                           IPreferences preferences,
                                           GitHubUserService gitHubUserService)
        {
            _azureFunctionsApiService = azureFunctionsApiService;
            _gitHubGraphQLApiService  = gitHubGraphQLApiService;
            _repositoryDatabase       = repositoryDatabase;
            _gitHubUserService        = gitHubUserService;
            _analyticsService         = analyticsService;
            _preferences = preferences;

            ThemeService.PreferenceChanged           += HandlePreferenceChanged;
            LanguageService.PreferredLanguageChanged += HandlePreferredLanguageChanged;
        }
        public RepositoryViewModel(RepositoryDatabase repositoryDatabase,
                                   GitHubAuthenticationService gitHubAuthenticationService,
                                   GitHubGraphQLApiService gitHubGraphQLApiService,
                                   AnalyticsService analyticsService,
                                   SortingService sortingService,
                                   GitHubApiV3Service gitHubApiV3Service) : base(analyticsService)
        {
            _repositoryDatabase          = repositoryDatabase;
            _gitHubAuthenticationService = gitHubAuthenticationService;
            _gitHubGraphQLApiService     = gitHubGraphQLApiService;
            _sortingService     = sortingService;
            _gitHubApiV3Service = gitHubApiV3Service;

            PullToRefreshCommand      = new AsyncCommand(() => ExecutePullToRefreshCommand(GitHubAuthenticationService.Alias));
            FilterRepositoriesCommand = new Command <string>(SetSearchBarText);
            SortRepositoriesCommand   = new Command <SortingOption>(ExecuteSortRepositoriesCommand);

            _gitHubAuthenticationService.LoggedOut += HandleGitHubAuthenticationServiceLoggedOut;
        }
示例#8
0
        public BackgroundFetchService(IAppInfo appInfo,
                                      GitHubUserService gitHubUserService,
                                      IAnalyticsService analyticsService,
                                      GitHubApiV3Service gitHubApiV3Service,
                                      RepositoryDatabase repositoryDatabase,
                                      NotificationService notificationService,
                                      ReferringSitesDatabase referringSitesDatabase,
                                      GitHubGraphQLApiService gitHubGraphQLApiService,
                                      GitHubApiRepositoriesService gitHubApiRepositoriesService)
        {
            _analyticsService             = analyticsService;
            _gitHubUserService            = gitHubUserService;
            _gitHubApiV3Service           = gitHubApiV3Service;
            _repositoryDatabase           = repositoryDatabase;
            _notificationService          = notificationService;
            _referringSitesDatabase       = referringSitesDatabase;
            _gitHubGraphQLApiService      = gitHubGraphQLApiService;
            _gitHubApiRepositoriesService = gitHubApiRepositoriesService;

            CleanUpDatabaseIdentifier            = $"{appInfo.PackageName}.{nameof(CleanUpDatabase)}";
            NotifyTrendingRepositoriesIdentifier = $"{appInfo.PackageName}.{nameof(NotifyTrendingRepositories)}";
        }
示例#9
0
        public RepositoryViewModel(IMainThread mainThread,
                                   ImageCachingService imageService,
                                   IAnalyticsService analyticsService,
                                   GitHubUserService gitHubUserService,
                                   MobileSortingService sortingService,
                                   RepositoryDatabase repositoryDatabase,
                                   GitHubApiV3Service gitHubApiV3Service,
                                   GitHubGraphQLApiService gitHubGraphQLApiService,
                                   GitHubApiExceptionService gitHubApiExceptionService,
                                   GitHubAuthenticationService gitHubAuthenticationService,
                                   GitHubApiRepositoriesService gitHubApiRepositoriesService) : base(analyticsService, mainThread)
        {
            LanguageService.PreferredLanguageChanged += HandlePreferredLanguageChanged;

            SetTitleText();

            _imageService                 = imageService;
            _gitHubUserService            = gitHubUserService;
            _mobileSortingService         = sortingService;
            _repositoryDatabase           = repositoryDatabase;
            _gitHubApiV3Service           = gitHubApiV3Service;
            _gitHubGraphQLApiService      = gitHubGraphQLApiService;
            _gitHubApiExceptionService    = gitHubApiExceptionService;
            _gitHubAuthenticationService  = gitHubAuthenticationService;
            _gitHubApiRepositoriesService = gitHubApiRepositoriesService;

            RefreshState = RefreshState.Uninitialized;

            PullToRefreshCommand      = new AsyncCommand(() => ExecutePullToRefreshCommand(gitHubUserService.Alias));
            FilterRepositoriesCommand = new Command <string>(SetSearchBarText);
            SortRepositoriesCommand   = new Command <SortingOption>(ExecuteSortRepositoriesCommand);

            NotificationService.SortingOptionRequested += HandleSortingOptionRequested;

            GitHubAuthenticationService.DemoUserActivated         += HandleDemoUserActivated;
            GitHubAuthenticationService.LoggedOut                 += HandleGitHubAuthenticationServiceLoggedOut;
            GitHubAuthenticationService.AuthorizeSessionCompleted += HandleAuthorizeSessionCompleted;
        }