本文整理汇总了C#中ITweet类的典型用法代码示例。如果您正苦于以下问题:C# ITweet类的具体用法?C# ITweet怎么用?C# ITweet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITweet类属于命名空间,在下文中一共展示了ITweet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map
public static AnalyzeTweet Map(ITweet tweet, string track)
{
return new AnalyzeTweet
{
Tweet = MapTweet(tweet, track)
};
}
示例2: MarkTweetAsReadCommand
public MarkTweetAsReadCommand(ITweet tweet, ITweetSink tweetSink)
{
_tweet = tweet;
_tweetSink = tweetSink;
_observer = new PropertyObserver<ITweet>(_tweet).
RegisterHandler(x => x.IsRead,
x => CanExecuteChanged(this, EventArgs.Empty));
}
示例3: SerializableTweet
public SerializableTweet(ITweet tweet)
{
this.Creator = tweet.Creator.Name;
this.CreatedAt = tweet.CreatedAt;
this.IsRetweet = tweet.IsRetweet;
this.Language = tweet.Language.ToString();
this.Retweeted = tweet.Retweeted;
this.Text = tweet.Text;
}
示例4: Add
public void Add(ITweet tweet)
{
lock (_mutex)
using (IDocumentSession session = _documentStore.OpenSession())
{
session.Store(tweet);
session.SaveChanges();
}
}
示例5: PublishTweet
// Publish Tweet
public string PublishTweet(ITweet tweet)
{
if (tweet == null)
{
throw new ArgumentException("Tweet cannot be null");
}
return PublishTweet(tweet.TweetDTO);
}
示例6: Map
public static TweetReceived Map(ITweet tweet, string track, string endpointName, Guid sessionId)
{
return new TweetReceived
{
EndpointName = endpointName,
SessionId = sessionId,
Tweet = Map(tweet, track)
};
}
示例7: SearchRepliesTo
public IEnumerable<ITweet> SearchRepliesTo(ITweet tweet, bool recursiveReplies)
{
if (tweet == null)
{
throw new ArgumentException("Tweet cannot be null");
}
var repliesDTO = _searchQueryExecutor.SearchRepliesTo(tweet.TweetDTO, recursiveReplies);
return _tweetFactory.GenerateTweetsFromDTO(repliesDTO);
}
示例8: TweetRating
public TweetRating(IAuthorizer client, ITweet tweet)
{
_client = client;
_tweet = tweet;
_observer = new PropertyObserver<IAuthorizer>(_client).
RegisterHandler(x => x.AuthenticatedUser,
x => UpdateIsMention());
UpdateIsMention();
}
示例9: FormatTweet
static string FormatTweet(ITweet tweet)
{
var builder = new StringBuilder();
builder.AppendLine(string.Format("{0} (@{1}) - {2}",
tweet.CreatedBy.Name,
tweet.CreatedBy.ScreenName,
tweet.CreatedAt.ToLocalTime().ToString("MM/dd/yy h:mm:ss tt")));
builder.AppendLine(tweet.Text);
return builder.ToString();
}
示例10: PublishTweetInReplyTo
// Publish Tweet InReplyTo
public bool PublishTweetInReplyTo(ITweet tweetToPublish, ITweet tweetToReplyTo)
{
if (tweetToPublish == null || tweetToReplyTo == null)
{
throw new ArgumentException("Tweet cannot be null!");
}
var publishedTweetDTO = PublishTweetDTOInReplyTo(tweetToPublish.TweetDTO, tweetToReplyTo.TweetDTO);
UpdateTweetIfTweetSuccessfullyBeenPublished(tweetToPublish, publishedTweetDTO);
return tweetToPublish.IsTweetPublished;
}
示例11: FollowUserIfRequired
public void FollowUserIfRequired(ITweet tweet)
{
if (FollowWords.Any(word => tweet.Text.IndexOf(word, StringComparison.OrdinalIgnoreCase) > -1))
{
try
{
User.GetLoggedUser().FollowUser(tweet.CreatedBy.Id);
}
catch (Exception)
{
// Ignore exceptions.
}
}
}
示例12: InviTweetToPTTweet
private static FSTweet InviTweetToPTTweet(ITweet t)
{
FSTweet ptTweet = new FSTweet();
if (t.Coordinates != null)
{
ptTweet.Coordinates = t.Coordinates.Longitude.ToString() + ","
+ t.Coordinates.Latitude.ToString();
}
ptTweet.CreatedOn = t.CreatedAt;
ptTweet.Id = t.Id.ToString();
ptTweet.ReplyToId = t.InReplyToUserIdStr;
ptTweet.Text = t.Text;
return ptTweet;
}
示例13: PublishTweet
public bool PublishTweet(ITweet tweet, IPublishTweetOptionalParameters optionalParameters = null)
{
if (tweet == null)
{
throw new ArgumentException("Tweet cannot be null!");
}
var parameters = new PublishTweetParameters(tweet.Text, optionalParameters);
var tweetDTO = InternalPublishTweet(parameters);
UpdateTweetIfTweetSuccessfullyBeenPublished(tweet, tweetDTO);
return tweet.IsTweetPublished;
}
示例14: InsereRC
private void InsereRC(ref Nodo N, ITweet value)
{
if (N == null)
{
Nodo novoNodo = new Nodo(value);
N = novoNodo;
}
else if (value.CreatedAt < N.valor.CreatedAt) // menor vai pra esquerda
InsereRC(ref N.esquerda, value);
else //if (value >= N.valor) // maior ou igual vai pra direita
InsereRC(ref N.direita, value);
return;
}
示例15: GetTweetMatchingSearchIDs
// find IDs of the search queries that correspond to the streamed tweet
private List<string> GetTweetMatchingSearchIDs(ITweet tweet, string streamQueryID, List<ArrayList<ArrayList<QueryToken>>> searchTokens, List<string> searchQueryIDs)
{
List<int> matchingIdx = CompareStreamToSearchIDs(streamQueryID, searchQueryIDs);
List<ArrayList<ArrayList<QueryToken>>> matchingSearchTokens = searchTokens.Where((x, idx) => matchingIdx.Contains(idx)).ToList();
List<int> matchingIDsIndeces = new List<int>();
foreach (var queryTokens in matchingSearchTokens.Select((value, idx) => new {idx, value}))
if (IsMatch(tweet, queryTokens.value))
matchingIDsIndeces.Add(queryTokens.idx);
matchingIdx = matchingIdx.Where((x, idx) => matchingIDsIndeces.Contains(idx)).ToList();
List<string> matchingIDs = searchQueryIDs.Where((x, idx) => matchingIdx.Contains(idx)).ToList();
return matchingIDs;
}