Ejemplo n.º 1
0
        private void StarOrWatch()
        {
            if (Settings.ShouldStar)
            {
                Settings.ShouldStar = false;

                _applicationService
                .GitHubClient.Activity.Starring
                .StarRepo("codehubapp", "codehub")
                .ToBackground();
            }

            if (Settings.ShouldWatch)
            {
                Settings.ShouldWatch = false;

                var subscription = new Octokit.NewSubscription
                {
                    Subscribed = true
                };

                _applicationService
                .GitHubClient.Activity.Watching
                .WatchRepo("codehubapp", "codehub", subscription)
                .ToBackground();
            }
        }
Ejemplo n.º 2
0
        private void StarOrWatch()
        {
            try
            {
                bool shouldStar;
                if (_defaultValueService.TryGet <bool>("SHOULD_STAR_CODEHUB", out shouldStar) && shouldStar)
                {
                    _defaultValueService.Set("SHOULD_STAR_CODEHUB", false);
                    _sessionService.GitHubClient.Activity.Starring.StarRepo("thedillonb", "codehub").ToBackground();
                }

                bool shouldWatch;
                if (_defaultValueService.TryGet <bool>("SHOULD_WATCH_CODEHUB", out shouldWatch) && shouldWatch)
                {
                    _defaultValueService.Set("SHOULD_WATCH_CODEHUB", false);
                    var subscription = new Octokit.NewSubscription {
                        Subscribed = true
                    };
                    _sessionService.GitHubClient.Activity.Watching.WatchRepo("thedillonb", "codehub", subscription).ToBackground();
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
        private void StarOrWatch()
        {
            try
            {
                bool shouldStar;
                if (_defaultValueService.TryGet<bool>("SHOULD_STAR_CODEHUB", out shouldStar) && shouldStar)
                {
                    _defaultValueService.Set("SHOULD_STAR_CODEHUB", false);
                    _sessionService.GitHubClient.Activity.Starring.StarRepo("thedillonb", "codehub").ToBackground();
                }

                bool shouldWatch;
                if (_defaultValueService.TryGet<bool>("SHOULD_WATCH_CODEHUB", out shouldWatch) && shouldWatch)
                {
                    _defaultValueService.Set("SHOULD_WATCH_CODEHUB", false);
                    var subscription = new Octokit.NewSubscription { Subscribed = true };
                    _sessionService.GitHubClient.Activity.Watching.WatchRepo("thedillonb", "codehub", subscription).ToBackground();
                }
            }
            catch
            {
            }
        }