Example #1
0
        public TrendsViewModel(IMainThread mainThread,
                               IAnalyticsService analyticsService,
                               GitHubApiV3Service gitHubApiV3Service,
                               GitHubApiStatusService gitHubApiStatusService,
                               GitHubGraphQLApiService gitHubGraphQLApiService,
                               TrendsChartSettingsService trendsChartSettingsService) : base(analyticsService, mainThread)
        {
            _gitHubApiV3Service      = gitHubApiV3Service;
            _gitHubApiStatusService  = gitHubApiStatusService;
            _gitHubGraphQLApiService = gitHubGraphQLApiService;

            IsViewsSeriesVisible        = trendsChartSettingsService.ShouldShowViewsByDefault;
            IsUniqueViewsSeriesVisible  = trendsChartSettingsService.ShouldShowUniqueViewsByDefault;
            IsClonesSeriesVisible       = trendsChartSettingsService.ShouldShowClonesByDefault;
            IsUniqueClonesSeriesVisible = trendsChartSettingsService.ShouldShowUniqueClonesByDefault;

            ViewsCardTappedCommand        = new Command(() => IsViewsSeriesVisible = !IsViewsSeriesVisible);
            UniqueViewsCardTappedCommand  = new Command(() => IsUniqueViewsSeriesVisible = !IsUniqueViewsSeriesVisible);
            ClonesCardTappedCommand       = new Command(() => IsClonesSeriesVisible = !IsClonesSeriesVisible);
            UniqueClonesCardTappedCommand = new Command(() => IsUniqueClonesSeriesVisible = !IsUniqueClonesSeriesVisible);

            RefreshState = RefreshState.Uninitialized;

            FetchDataCommand = new AsyncCommand <(Repository Repository, CancellationToken CancellationToken)>(tuple => ExecuteFetchDataCommand(tuple.Repository, tuple.CancellationToken));
        }
Example #2
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;
        }
Example #3
0
 public UITestBackdoorService(GitHubAuthenticationService gitHubAuthenticationService,
                              GitHubGraphQLApiService gitHubGraphQLApiService,
                              TrendsChartSettingsService trendsChartSettingsService)
 {
     _gitHubAuthenticationService = gitHubAuthenticationService;
     _gitHubGraphQLApiService     = gitHubGraphQLApiService;
     _trendsChartSettingsService  = trendsChartSettingsService;
 }
 public GitHubAuthenticationService(AzureFunctionsApiService azureFunctionsApiService,
                                    GitHubGraphQLApiService gitHubGraphQLApiService,
                                    RepositoryDatabase repositoryDatabase)
 {
     _azureFunctionsApiService = azureFunctionsApiService;
     _gitHubGraphQLApiService  = gitHubGraphQLApiService;
     _repositoryDatabase       = repositoryDatabase;
 }
 public GitHubApiRepositoriesService(IAnalyticsService analyticsService,
                                     GitHubUserService gitHubUserService,
                                     GitHubApiV3Service gitHubApiV3Service,
                                     GitHubGraphQLApiService gitHubGraphQLApiService)
 {
     _analyticsService        = analyticsService;
     _gitHubUserService       = gitHubUserService;
     _gitHubApiV3Service      = gitHubApiV3Service;
     _gitHubGraphQLApiService = gitHubGraphQLApiService;
 }
Example #6
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));
        }
Example #7
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;
        }
Example #9
0
 public UITestsBackdoorService(GitHubAuthenticationService gitHubAuthenticationService,
                               NotificationService notificationService,
                               GitHubGraphQLApiService gitHubGraphQLApiService,
                               TrendsChartSettingsService trendsChartSettingsService,
                               ThemeService themeService,
                               GitHubUserService gitHubUserService,
                               IMainThread mainThread)
 {
     _mainThread                  = mainThread;
     _themeService                = themeService;
     _gitHubUserService           = gitHubUserService;
     _notificationService         = notificationService;
     _gitHubGraphQLApiService     = gitHubGraphQLApiService;
     _trendsChartSettingsService  = trendsChartSettingsService;
     _gitHubAuthenticationService = gitHubAuthenticationService;
 }
        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;
        }
Example #12
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)}";
        }
Example #13
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;
        }
 public UITestBackdoorService(GitHubAuthenticationService gitHubAuthenticationService, GitHubGraphQLApiService gitHubGraphQLApiService) =>
 (_gitHubAuthenticationService, _gitHubGraphQLApiService) = (gitHubAuthenticationService, gitHubGraphQLApiService);