RepositoryLanguages() публичный статический Метод

Returns the Uri for repository languages.
public static RepositoryLanguages ( long repositoryId ) : Uri
repositoryId long The Id of the repository
Результат Uri
Пример #1
0
        /// <summary>
        /// Gets all languages for the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-languages">API documentation</a> for more details
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <returns>All languages used in the repository and the number of bytes of each language.</returns>
        public async Task <IReadOnlyList <RepositoryLanguage> > GetAllLanguages(long repositoryId)
        {
            var endpoint = ApiUrls.RepositoryLanguages(repositoryId);
            var data     = await ApiConnection.Get <Dictionary <string, long> >(endpoint).ConfigureAwait(false);

            return(new ReadOnlyCollection <RepositoryLanguage>(
                       data.Select(kvp => new RepositoryLanguage(kvp.Key, kvp.Value)).ToList()));
        }
Пример #2
0
        /// <summary>
        /// Gets all languages for the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-languages">API documentation</a> for more details
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <returns>All languages used in the repository and the number of bytes of each language.</returns>
        public async Task <IReadOnlyList <RepositoryLanguage> > GetAllLanguages(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            var endpoint = ApiUrls.RepositoryLanguages(owner, name);
            var data     = await ApiConnection.Get <Dictionary <string, long> >(endpoint).ConfigureAwait(false);

            return(new ReadOnlyCollection <RepositoryLanguage>(
                       data.Select(kvp => new RepositoryLanguage(kvp.Key, kvp.Value)).ToList()));
        }
Пример #3
0
        /// <summary>
        /// Gets all languages for the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-languages">API documentation</a> for more details
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <returns>All languages used in the repository and the number of bytes of each language.</returns>
        public Task <IReadOnlyList <RepositoryLanguage> > GetAllLanguages(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return(ApiConnection
                   .Get <IDictionary <string, long> >(ApiUrls.RepositoryLanguages(owner, name))
                   .ContinueWith <IReadOnlyList <RepositoryLanguage> >(t =>
                                                                       new ReadOnlyCollection <RepositoryLanguage>(
                                                                           t.Result.Select(kvp => new RepositoryLanguage(kvp.Key, kvp.Value)).ToList()
                                                                           ),
                                                                       TaskContinuationOptions.OnlyOnRanToCompletion));
        }