Exemple #1
0
        /// <summary>
        /// Get direct messages with full params
        /// </summary>
        private static IEnumerable <TwitterDirectMessage> GetDirectMessages(this CredentialProvider provider, string partialUri, long?sinceId, long?maxId, long?count, long?page)
        {
            List <KeyValuePair <string, string> > para = new List <KeyValuePair <string, string> >();

            if (sinceId != null && sinceId.HasValue)
            {
                para.Add(new KeyValuePair <string, string>("since_id", sinceId.Value.ToString()));
            }
            if (maxId != null && maxId.HasValue)
            {
                para.Add(new KeyValuePair <string, string>("max_id", maxId.Value.ToString()));
            }
            if (count != null && count.HasValue)
            {
                para.Add(new KeyValuePair <string, string>("count", count.Value.ToString()));
            }
            if (page != null && page.HasValue)
            {
                para.Add(new KeyValuePair <string, string>("page", page.Value.ToString()));
            }

            para.Add(new KeyValuePair <string, string>("include_entities", "true"));

            return(provider.GetDirectMessages(partialUri, para));
        }
Exemple #2
0
 /// <summary>
 /// Get direct messages you sent with full params
 /// </summary>
 public static IEnumerable <TwitterDirectMessage> GetSentDirectMessages(this CredentialProvider provider, long?sinceId = null, long?maxId = null, long?count = null, long?page = null, bool?includeEntities = null)
 {
     return(provider.GetDirectMessages("direct_messages/sent.json", sinceId, maxId, count, page));
 }
Exemple #3
0
 /// <summary>
 /// Get direct messages you sent
 /// </summary>
 /// <param name="provider">credential provider</param>
 public static IEnumerable <TwitterDirectMessage> GetSentDirectMessages(this CredentialProvider provider)
 {
     return(provider.GetDirectMessages("direct_messages/sent.json", null));
 }