Example #1
0
        public TabViewModel(ColumnViewModel parent, TabProperty property = null)
        {
            this.Parent = parent;

            this.IsAlive = true;
            this.TabProperty = property ?? new TabProperty();

            // 初期TLとしてnullを
            this.AddTopTimeline(null);
            ViewModelHelper.BindNotification(Setting.SettingValueChangedEvent, this, (o, e) => UpdateSettingValue());
        }
Example #2
0
 public TabEditorViewModel(TabProperty property)
 {
     this.property = property;
     this._filterEditorViewModel = new FilterEditorViewModel(property.TweetSources.ToArray());
 }
Example #3
0
 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;
         }
     }
 }
Example #4
0
 public static bool IsFollowingCurrent(UserViewModel user, TabProperty property)
 {
     if (user == null) return false;
     return property.LinkAccountInfos.All(i => i.IsFollowing(user.TwitterUser.NumericId));
 }
Example #5
0
 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));
 }
Example #6
0
 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));
 }
Example #7
0
 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);
 }
Example #8
0
 private TabProperty ShowTabEditor(TabProperty property = null)
 {
     if(property == null)
         property = new TabProperty();
     var vm = new TabEditorViewModel(property);
     this.Messenger.Raise(new TransitionMessage(vm, "EditTab"));
     property.TweetSources = vm.FilterEditorViewModel.RootFilters;
     return property;
 }
Example #9
0
 /// <summary>
 /// タブをこのカラムの末尾に追加します。
 /// </summary>
 public TabViewModel AddTab(TabProperty tabProperty = null)
 {
     var nvm = new TabViewModel(this, tabProperty);
     this.AddTab(nvm);
     return nvm;
 }
 private void CreateTab(TabProperty property)
 {
     KernelService.MainWindowViewModel.ColumnOwnerViewModel.CurrentFocusColumn.AddTab(property);
 }