コード例 #1
0
        internal new static RestCommunity Create(BaseRestClient client, Model model)
        {
            var entity = new RestCommunity(client, model.Id);

            entity.Update(model);
            return(entity);
        }
コード例 #2
0
ファイル: ClientHelper.cs プロジェクト: kouweizhong/NTwitch
        // Communities
        public static async Task <RestCommunity> GetCommunityAsync(BaseTwitchClient client, string communityId, bool isname, RequestOptions options = null)
        {
            var model = await client.ApiClient.GetCommunityAsync(communityId, isname, options).ConfigureAwait(false);

            if (model != null)
            {
                return(RestCommunity.Create(client, model));
            }
            return(null);
        }
コード例 #3
0
ファイル: RestCommunity.cs プロジェクト: kouweizhong/NTwitch
 internal void Update(RestCommunity community)
 {
     base.Update(community);
     OwnerId         = community.OwnerId;
     Summary         = community.Summary;
     Description     = community.Description;
     DescriptionHtml = community.DescriptionHtml;
     Rules           = community.Rules;
     RulesHtml       = community.RulesHtml;
     Language        = community.Language;
     CoverUrl        = community.CoverUrl;
 }
コード例 #4
0
        public static async Task <RestCommunity> GetCommunityAsync(BaseRestClient client, string id, bool isname = false)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetCommunityInternalAsync(token, id, isname);

            if (model == null)
            {
                return(null);
            }

            return(RestCommunity.Create(client, model));
        }