示例#1
0
        private void GetStatusReplied(TwitterStatus status)
        {
            if (status.InReplyToStatusId != null)
            {
                Interlocked.Increment(ref pendingCalls);
                service.GetTweet(new GetTweetOptions {
                    Id = (long)status.InReplyToStatusId
                }, (result, response) =>
                {
                    if (result == null || response.StatusCode != HttpStatusCode.OK)
                    {
                        RaiseCallback(new List <TwitterStatus>(), response); // report the error
                        TryFinish();
                        return;
                    }

                    okResponse = response;
                    if (!searchCache.Contains(result))
                    {
                        searchCache.Add(result);
                    }

                    RaiseCallback(new List <TwitterStatus> {
                        status, result
                    }, response);

                    GetConversationForStatus(result);

                    TryFinish();
                });
            }
        }
示例#2
0
        public Post Get(long id)
        {
            if (id == 0)
            {
                throw new TwitterMessageIdentifierUndefinedException();
            }
            Post post = Make(_service.GetTweet(id));

            return(post);
        }
示例#3
0
 public Post Get(long id)
 {
     try
     {
         Post post = Make(_twitterService.GetTweet(id));
         return(post);
     }
     catch (Exception)
     {
         throw new IdentifierUndefinedException();
     }
 }