コード例 #1
0
ファイル: TagMethods.cs プロジェクト: lfoust/stacky
        /// <summary>
        /// Returns the top 30 question askers active in a single tag, of either all-time or the last 30 days.
        /// </summary>
        /// <param name="onSuccess"></param>
        /// <param name="onError"></param>
        /// <param name="tags">The list of tags to query</param>
        /// <param name="period">The time period to query</param>
        /// <returns></returns>
        public void GetTopAnswerers(Action <IEnumerable <TopUser> > onSuccess, Action <ApiException> onError, IEnumerable <string> tags, TopUserPeriod period)
        {
            var sortArgs = period.GetAttribute <SortArgsAttribute>();

            MakeRequest <TopUserResponse>("tags", new string[] { tags.Vectorize(), "top-answerers", sortArgs.Sort }, new
            {
                key = apiKey
            }, (items) => onSuccess(items.TopUsers), onError);
        }
コード例 #2
0
        /// <summary>
        /// Returns the top 30 question answerers active in a single tag, of either all-time or the last 30 days.
        /// </summary>
        /// <param name="tags">The list of tags to query</param>
        /// <param name="period">The time period to query</param>
        /// <returns></returns>
        public IEnumerable <TopUser> GetTopAnswerers(IEnumerable <string> tags, TopUserPeriod period)
        {
            var sortArgs = period.GetAttribute <SortArgsAttribute>();
            var response = MakeRequest <TopUserResponse>("tags", new string[] { tags.Vectorize(), "top-answerers", sortArgs.Sort }, new
            {
                key = apiKey
            });

            return(response.TopUsers);
        }