• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TimelineChild.TweetViewModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InstallerLib.ConfigFile类代码示例发布时间:2022-05-26
下一篇:
C# Authentication.AccountInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap