예제 #1
0
        /// <summary>
        /// Initializes the command.
        /// </summary>
        public override void Init()
        {
            GetListMembersOptions options = this.OptionalProperties as GetListMembersOptions;

            if (options == null || options.Cursor == 0)
            {
                this.RequestParameters.Add("cursor", "-1");
            }
            else
            {
                this.RequestParameters.Add("cursor", options.Cursor.ToString(CultureInfo.InvariantCulture));
            }
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetListsCommand"/> class.
        /// </summary>
        /// <param name="requestTokens">The request tokens.</param>
        /// <param name="username">The username.</param>
        /// <param name="listIdOrSlug">The list id or slug.</param>
        /// <param name="options">The options.</param>
        public GetListMembersCommand(OAuthTokens requestTokens, string username, string listIdOrSlug, GetListMembersOptions options)
            : base(HttpMethod.Get, string.Format(CultureInfo.CurrentCulture, "{0}/{1}/members.json", username, listIdOrSlug), requestTokens, options)
        {
            if (requestTokens == null)
            {
                throw new ArgumentNullException("requestTokens");
            }

            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentNullException("username");
            }

            if (string.IsNullOrEmpty(listIdOrSlug))
            {
                throw new ArgumentNullException("listIdOrSlug");
            }

            this.DeserializationHandler = TwitterUserCollection.DeserializeWrapper;
        }