/// <summary>
        /// Initializes a new GitHub Repos API client.
        /// </summary>
        /// <param name="apiConnection">An API connection</param>
        public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection)
        {
            Status = new CommitStatusClient(apiConnection);
            Hooks = new RepositoryHooksClient(apiConnection);
            Forks = new RepositoryForksClient(apiConnection);
#pragma warning disable CS0618 // Type or member is obsolete
            RepoCollaborators = new RepoCollaboratorsClient(apiConnection);
#pragma warning restore CS0618 // Type or member is obsolete
            Collaborator = new RepoCollaboratorsClient(apiConnection);
            Statistics = new StatisticsClient(apiConnection);
            Deployment = new DeploymentsClient(apiConnection);
            PullRequest = new PullRequestsClient(apiConnection);
#pragma warning disable CS0618 // Type or member is obsolete
            RepositoryComments = new RepositoryCommentsClient(apiConnection);
#pragma warning restore CS0618 // Type or member is obsolete
            Comment = new RepositoryCommentsClient(apiConnection);
#pragma warning disable CS0618 // Type or member is obsolete
            Commits = new RepositoryCommitsClient(apiConnection);
#pragma warning restore CS0618 // Type or member is obsolete
            Commit = new RepositoryCommitsClient(apiConnection);
            Release = new ReleasesClient(apiConnection);
            DeployKeys = new RepositoryDeployKeysClient(apiConnection);
            Merging = new MergingClient(apiConnection);
            Content = new RepositoryContentsClient(apiConnection);
            Page = new RepositoryPagesClient(apiConnection);
        }
Example #2
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests.</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);

            Authorization = new AuthorizationsClient(apiConnection);
            Issue         = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification  = new NotificationsClient(apiConnection);
            Organization  = new OrganizationsClient(apiConnection);
            Repository    = new RepositoriesClient(apiConnection);
            Release       = new ReleasesClient(apiConnection);
            User          = new UsersClient(apiConnection);
            SshKey        = new SshKeysClient(apiConnection);
        }
Example #3
0
 /// <summary>
 /// Initializes a new GitHub Repos API client.
 /// </summary>
 /// <param name="apiConnection">An API connection</param>
 public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection)
 {
     Status       = new CommitStatusClient(apiConnection);
     Hooks        = new RepositoryHooksClient(apiConnection);
     Forks        = new RepositoryForksClient(apiConnection);
     Collaborator = new RepoCollaboratorsClient(apiConnection);
     Statistics   = new StatisticsClient(apiConnection);
     Deployment   = new DeploymentsClient(apiConnection);
     PullRequest  = new PullRequestsClient(apiConnection);
     Comment      = new RepositoryCommentsClient(apiConnection);
     Commit       = new RepositoryCommitsClient(apiConnection);
     Release      = new ReleasesClient(apiConnection);
     DeployKeys   = new RepositoryDeployKeysClient(apiConnection);
     Merging      = new MergingClient(apiConnection);
     Content      = new RepositoryContentsClient(apiConnection);
     Page         = new RepositoryPagesClient(apiConnection);
     Invitation   = new RepositoryInvitationsClient(apiConnection);
 }
 /// <summary>
 /// Initializes a new GitHub Repos API client.
 /// </summary>
 /// <param name="apiConnection">An API connection</param>
 public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection)
 {
     Status = new CommitStatusClient(apiConnection);
     Hooks = new RepositoryHooksClient(apiConnection);
     Forks = new RepositoryForksClient(apiConnection);
     Collaborator = new RepoCollaboratorsClient(apiConnection);
     Statistics = new StatisticsClient(apiConnection);
     Deployment = new DeploymentsClient(apiConnection);
     PullRequest = new PullRequestsClient(apiConnection);
     Comment = new RepositoryCommentsClient(apiConnection);
     Commit = new RepositoryCommitsClient(apiConnection);
     Release = new ReleasesClient(apiConnection);
     DeployKeys = new RepositoryDeployKeysClient(apiConnection);
     Merging = new MergingClient(apiConnection);
     Content = new RepositoryContentsClient(apiConnection);
     Page = new RepositoryPagesClient(apiConnection);
     Invitation = new RepositoryInvitationsClient(apiConnection);
 }
Example #5
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);

            Authorization = new AuthorizationsClient(apiConnection);
            Activity      = new ActivitiesClient(apiConnection);
            Issue         = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification  = new NotificationsClient(apiConnection);
            Organization  = new OrganizationsClient(apiConnection);
            Repository    = new RepositoriesClient(apiConnection);
            Gist          = new GistsClient(apiConnection);
            Release       = new ReleasesClient(apiConnection);
            User          = new UsersClient(apiConnection);
            SshKey        = new SshKeysClient(apiConnection);
            GitDatabase   = new GitDatabaseClient(apiConnection);
            Search        = new SearchClient(apiConnection);
            Deployment    = new DeploymentsClient(apiConnection);
        }
Example #6
0
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests.</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);
            Authorization = new AuthorizationsClient(apiConnection);
            Issue = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification = new NotificationsClient(apiConnection);
            Organization = new OrganizationsClient(apiConnection);
            Repository = new RepositoriesClient(apiConnection);
            Release = new ReleasesClient(apiConnection);
            User = new UsersClient(apiConnection);
            SshKey = new SshKeysClient(apiConnection);
        }
        /// <summary>
        /// Create a new instance of the GitHub API v3 client using the specified connection.
        /// </summary>
        /// <param name="connection">The underlying <seealso cref="IConnection"/> used to make requests</param>
        public GitHubClient(IConnection connection)
        {
            Ensure.ArgumentNotNull(connection, "connection");

            Connection = connection;
            var apiConnection = new ApiConnection(connection);
            Authorization = new AuthorizationsClient(apiConnection);
            Activity = new ActivitiesClient(apiConnection);
            Issue = new IssuesClient(apiConnection);
            Miscellaneous = new MiscellaneousClient(connection);
            Notification = new NotificationsClient(apiConnection);
            Oauth = new OauthClient(connection);
            Organization = new OrganizationsClient(apiConnection);
            PullRequest = new PullRequestsClient(apiConnection);
            Repository = new RepositoriesClient(apiConnection);
            Gist = new GistsClient(apiConnection);
            Release = new ReleasesClient(apiConnection);
            User = new UsersClient(apiConnection);
            SshKey = new SshKeysClient(apiConnection);
            GitDatabase = new GitDatabaseClient(apiConnection);
            Search = new SearchClient(apiConnection);
            Deployment = new DeploymentsClient(apiConnection);
        }
Example #8
0
        // this constructor is called from XAML - use fixed dependencies
        public MiningViewModel()
        {
            // enforce a minimum of ten seconds for the polling period
            var pollingPeriod = TimeSpan.FromSeconds(Math.Max(TimeSpan.FromSeconds(10).TotalSeconds, Settings.Default.MinerWatchdogPollingPeriod.TotalSeconds));
            if (pollingPeriod != Settings.Default.MinerWatchdogPollingPeriod)
            {
                AddMessage(string.Format("Setting MinerWatchdogPollingPeriod to minimum polling period [{0}].", pollingPeriod));
            }

            IController controller = null;
            ISummaryDataManager dataManager = null;
            if (!IsDesignMode)
            {
                var minerComms = new MinerCommunication(Settings.Default.MinerProcessName, Settings.Default.LaunchCommand, Settings.Default.ImportantProcessNames.Cast<string>());
                controller = new Controller(minerComms, pollingPeriod);
                dataManager = new SummaryDataManager(Settings.Default.SaveInterval);
            }

            var idleTimeProvider = new IdleTimeProvider();
            var windowController = new WindowController();

            var conn = new Connection(new ProductHeaderValue(Title.Replace(" ", string.Empty)));
            var api = new ApiConnection(conn);
            var releasesClient = new ReleasesClient(api);

            var versionService = new VersionService(releasesClient, GitHubOwner, GitHubRepo);

            this.InitializeDesignTime(controller, idleTimeProvider, dataManager, windowController, versionService);
        }