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()); }
public TabEditorViewModel(TabProperty property) { this.property = property; this._filterEditorViewModel = new FilterEditorViewModel(property.TweetSources.ToArray()); }
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; } } }
public static bool IsFollowingCurrent(UserViewModel user, TabProperty property) { if (user == null) return false; return property.LinkAccountInfos.All(i => i.IsFollowing(user.TwitterUser.NumericId)); }
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)); }
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)); }
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); }
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; }
/// <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); }