本文整理汇总了C#中Inscribe.ViewModels.PartBlocks.MainBlock.TimelineChild.TweetViewModel类的典型用法代码示例。如果您正苦于以下问题:C# TweetViewModel类的具体用法?C# TweetViewModel怎么用?C# TweetViewModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TweetViewModel类属于Inscribe.ViewModels.PartBlocks.MainBlock.TimelineChild命名空间,在下文中一共展示了TweetViewModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetSuggestedUser
public static TwitterUser GetSuggestedUser(TweetViewModel status)
{
if (IsPublishedByRetweet(status))
return ((TwitterStatus)status.Status).RetweetedOriginal.User;
else
return status.Status.User;
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:7,代码来源:TwitterHelper.cs
示例2: TabDependentTweetViewModel
public TabDependentTweetViewModel(TweetViewModel tvm, TabViewModel parent)
{
if (tvm == null)
throw new ArgumentNullException("tvm");
if (parent == null)
throw new ArgumentNullException("parent");
this.Parent = parent;
this.Tweet = tvm;
switch (Setting.Instance.TimelineExperienceProperty.TimelineItemInitStrategy)
{
case ItemInitStrategy.None:
break;
case ItemInitStrategy.DefaultColors:
_lightningColorCache = Setting.Instance.ColoringProperty.BaseHighlightColor.GetColor();
_foreColorCache = Setting.Instance.ColoringProperty.BaseColor.GetDarkColor();
_backColorCache = Setting.Instance.ColoringProperty.BaseColor.GetLightColor();
_foreBrushCache = new SolidColorBrush(_foreColorCache).CloneFreeze();
_backBrushCache = new SolidColorBrush(_backColorCache).CloneFreeze();
break;
case ItemInitStrategy.Full:
CommitColorChanged(true);
break;
}
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:25,代码来源:TabDependentTweetViewModel.cs
示例3: EventDescription
public EventDescription(EventKind kind, UserViewModel source, UserViewModel target, TweetViewModel tweet = null)
{
this.CreatedAt = DateTime.Now;
this.Kind = kind;
this.SourceUser = source;
this.TargetUser = target;
this.TargetTweet = tweet;
}
开发者ID:rhenium,项目名称:Mystique,代码行数:8,代码来源:EventStorage.cs
示例4: QueueNotify
public static void QueueNotify(TweetViewModel tweet, string soundSource = null)
{
if (soundSource == null)
soundSource = String.Empty;
lock (waitingsLocker)
{
if (waitings.ContainsKey(tweet))
waitings[tweet] = soundSource;
}
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:10,代码来源:NotificationCore.cs
示例5: RegisterNotify
public static void RegisterNotify(TweetViewModel tweet)
{
if (!Setting.Instance.NotificationProperty.NotifyReceives ||
tweet.CreatedAt < DateTime.Now.Subtract(TimeSpan.FromMinutes(10)) ||
!CheckIsAllowed(tweet))
return;
lock (waitingsLocker)
{
if (!waitings.ContainsKey(tweet))
waitings.Add(tweet, null);
}
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:12,代码来源:NotificationCore.cs
示例6: DispatchNotify
public static void DispatchNotify(TweetViewModel tweet)
{
lock (waitingsLocker)
{
if (waitings.ContainsKey(tweet))
{
var notify = waitings[tweet];
waitings.Remove(tweet);
if (notify != null)
IssueNotification(UserStorage.Get(tweet.Status.User), null, tweet.Status.Text, EventKind.Undefined, notify);
}
}
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:13,代码来源:NotificationCore.cs
示例7: DispatchNotify
public static void DispatchNotify(TweetViewModel tweet)
{
lock (waitingsLocker)
{
if (waitings.ContainsKey(tweet))
{
var notify = waitings[tweet];
waitings.Remove(tweet);
if (notify != null)
{
UserViewModel source = UserStorage.Get(tweet.Status.User);
RaiseNotificationEvent(null, new EventDescriptionEventArgs(new EventDescription(EventKind.Undefined, source, null, tweet)));
IssueNotification(source, null, tweet.Status.Text, EventKind.Undefined, notify);
}
}
}
}
开发者ID:alemonmk,项目名称:Mystique,代码行数:17,代码来源:NotificationCore.cs
示例8: UnfavTweetSink
private static void UnfavTweetSink(IEnumerable<AccountInfo> infos, TweetViewModel status)
{
var ts = status.Status as TwitterStatus;
if (ts == null)
{
NotifyStorage.Notify("DirectMessageはFavできません。");
return;
}
if (ts.RetweetedOriginal != null)
status = TweetStorage.Get(ts.RetweetedOriginal.Id, true);
if (status == null)
{
NotifyStorage.Notify("Unfav 対象ステータスが見つかりません。");
return;
}
bool success = true;
Parallel.ForEach(infos,
(d) =>
{
var ud = d.UserViewModel;
// ふぁぼり状態更新
if (ud != null)
status.RemoveFavored(ud);
try
{
unfavoriteInjection.Execute(new Tuple<AccountInfo, TweetViewModel>(d, status));
}
catch (Exception ex)
{
success = false;
if (ud != null)
status.RegisterFavored(ud);
NotifyStorage.Notify("Unfavに失敗しました: @" + d.ScreenName);
if (!(ex is ApplicationException))
{
ExceptionStorage.Register(ex, ExceptionCategory.TwitterError,
"Unfav操作時にエラーが発生しました");
}
}
});
if (success)
NotifyStorage.Notify("Unfavしました: @" + status.Status.User.ScreenName + ": " + status.Status.Text);
}
开发者ID:azyobuzin,项目名称:Mystique,代码行数:43,代码来源:PostOffice.cs
示例9: UnretweetSink
private static void UnretweetSink(IEnumerable<AccountInfo> infos, TweetViewModel status)
{
var ts = status.Status as TwitterStatus;
if (ts == null)
{
NotifyStorage.Notify("DirectMessageはUnretweetできません。");
return;
}
if (ts.RetweetedOriginal != null)
status = TweetStorage.Get(ts.RetweetedOriginal.Id, true);
if (status == null)
{
NotifyStorage.Notify("Retweet オリジナルデータが見つかりません。");
return;
}
bool success = true;
Parallel.ForEach(infos,
d =>
{
// リツイート状態更新
var ud = d.UserViewModel;
if (ud != null)
status.RegisterRetweeted(ud);
try
{
unretweetInjection.Execute(new Tuple<AccountInfo, TweetViewModel>(d, status));
}
catch (Exception ex)
{
if (ud != null)
status.RemoveRetweeted(ud);
success = false;
NotifyStorage.Notify("Retweetキャンセルに失敗しました: @" + d.ScreenName);
if (!(ex is ApplicationException))
{
ExceptionStorage.Register(ex, ExceptionCategory.TwitterError,
"Retweetキャンセル操作時にエラーが発生しました");
}
}
});
if (success)
NotifyStorage.Notify("Retweetをキャンセルしました: @" + status.Status.User.ScreenName + ": " + status.Status.Text);
}
开发者ID:azyobuzin,项目名称:Mystique,代码行数:44,代码来源:PostOffice.cs
示例10: IsFavoredThis
public static bool IsFavoredThis(TweetViewModel status)
{
if (status == null || !status.IsStatusInfoContains) return false;
var fvd = status.FavoredUsers.Select(d => d.TwitterUser.ScreenName).ToArray();
return AccountStorage.Accounts.Any(d => fvd.Contains(d.ScreenName));
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:6,代码来源:TwitterHelper.cs
示例11: UnfavTweetCore
private static void UnfavTweetCore(AccountInfo d, TweetViewModel status)
{
if (ApiHelper.ExecApi(() => d.DestroyFavorites(status.Status.Id)) == null)
throw new ApplicationException();
}
开发者ID:azyobuzin,项目名称:Mystique,代码行数:5,代码来源:PostOffice.cs
示例12: OnRetweeted
public static void OnRetweeted(TweetViewModel tweet, UserViewModel retweeter)
{
if (AccountStorage.Contains(retweeter.TwitterUser.ScreenName) || tweet.CreatedAt < wakeupTime)
return;
Register(new EventDescription(EventKind.Retweet, retweeter,
UserStorage.Get(tweet.Status.User), tweet));
}
开发者ID:rhenium,项目名称:Mystique,代码行数:7,代码来源:EventStorage.cs
示例13: IsMyCurrentTweet
public static bool IsMyCurrentTweet(TweetViewModel status, TabProperty property)
{
if (status == null || !status.IsStatusInfoContains || property == null) return false;
return property.LinkAccountScreenNames.Any(a => a == status.Status.User.ScreenName);
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:5,代码来源:TwitterHelper.cs
示例14: FavTweetSink
public static void FavTweetSink(IEnumerable<AccountInfo> infos, TweetViewModel status)
{
var ts = status.Status as TwitterStatus;
if (ts == null)
{
NotifyStorage.Notify("DirectMessageはFavできません。");
return;
}
if (ts.RetweetedOriginal != null)
status = TweetStorage.Get(ts.RetweetedOriginal.Id, true);
if (status == null)
{
NotifyStorage.Notify("Fav 対象ステータスが見つかりません。");
return;
}
bool success = true;
Parallel.ForEach(infos,
(d) =>
{
var ud = d.UserViewModel;
// ふぁぼり状態更新
if (ud != null)
status.RegisterFavored(ud);
try
{
favoriteInjection.Execute(new Tuple<AccountInfo, TweetViewModel>(d, status));
}
catch (Exception ex)
{
success = false;
if (ud != null)
status.RemoveFavored(ud);
if (ex is FavoriteSuspendedException && Setting.Instance.InputExperienceProperty.EnableFavoriteFallback)
{
// ふぁぼ規制 -> フォールバック
AccountInfo fallback = null;
if(!String.IsNullOrEmpty( d.AccountProperty.FallbackAccount) &&
(fallback = AccountStorage.Get(d.AccountProperty.FallbackAccount)) != null &&
!status.FavoredUsers.Contains(fallback.UserViewModel))
{
NotifyStorage.Notify("Fav fallbackします: @" + d.ScreenName + " >> @");
FavTweetSink(new[] { fallback }, status);
}
}
else
{
NotifyStorage.Notify("Favに失敗しました: @" + d.ScreenName);
if (!(ex is ApplicationException))
{
ExceptionStorage.Register(ex, ExceptionCategory.TwitterError,
"Fav操作時にエラーが発生しました");
}
}
}
});
if (success)
NotifyStorage.Notify("Favしました: @" + status.Status.User.ScreenName + ": " + status.Status.Text);
}
开发者ID:azyobuzin,项目名称:Mystique,代码行数:58,代码来源:PostOffice.cs
示例15: RemoveTweet
private void RemoveTweet(TweetViewModel tvm)
{
this._tweetsSource.Remove(new TabDependentTweetViewModel(tvm, this.Parent));
}
开发者ID:alemonmk,项目名称:Mystique,代码行数:4,代码来源:TimelineListCoreViewModel.cs
示例16: IsInReplyToMeCurrentStrict
public static bool IsInReplyToMeCurrentStrict(TweetViewModel status, TabProperty property)
{
if (status == null || !status.IsStatusInfoContains || property == null) return false;
var s = status.Status as TwitterStatus;
if (s != null)
{
return property.LinkAccountScreenNames.Any(a => a == s.InReplyToUserScreenName);
}
else
{
var dm = status.Status as TwitterDirectMessage;
if (dm != null)
{
return property.LinkAccountScreenNames.Any(a => a == dm.Recipient.ScreenName);
}
else
{
return false;
}
}
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:21,代码来源:TwitterHelper.cs
示例17: OnUnfavored
public static void OnUnfavored(TweetViewModel tweet, UserViewModel favorer)
{
if (AccountStorage.Contains(favorer.TwitterUser.ScreenName))
return;
Register(new EventDescription(EventKind.Unfavorite,
favorer, UserStorage.Get(tweet.Status.User), tweet));
}
开发者ID:sor593,项目名称:Mystique,代码行数:7,代码来源:EventStorage.cs
示例18: IsInReplyToMeCurrent
public static bool IsInReplyToMeCurrent(TweetViewModel status, TabProperty property)
{
if (status == null || !status.IsStatusInfoContains || property == null) return false;
return property.LinkAccountScreenNames.Any(a =>
Regex.IsMatch(status.Status.Text, "@" + a + "(?![a-zA-Z0-9_])", RegexOptions.Singleline | RegexOptions.IgnoreCase));
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:6,代码来源:TwitterHelper.cs
示例19: IsInReplyToMe
public static bool IsInReplyToMe(TweetViewModel status)
{
if (status == null || !status.IsStatusInfoContains) return false;
return AccountStorage.Accounts.Any(d =>
Regex.IsMatch(status.Status.Text, "@" + d.ScreenName + "(?![a-zA-Z0-9_])", RegexOptions.Singleline | RegexOptions.IgnoreCase));
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:6,代码来源:TwitterHelper.cs
示例20: IsFavoredThisWithCurrent
public static bool IsFavoredThisWithCurrent(TweetViewModel status, TabProperty property)
{
if (status == null || !status.IsStatusInfoContains || property == null) return false;
var fvd = status.FavoredUsers.Select(d => d.TwitterUser.ScreenName).ToArray();
return property.LinkAccountScreenNames.Any(a => fvd.Contains(a));
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:6,代码来源:TwitterHelper.cs
注:本文中的Inscribe.ViewModels.PartBlocks.MainBlock.TimelineChild.TweetViewModel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论