/// <summary> /// 通知をスタックに積む /// </summary> /// <param name="sentUser">通知を発生させたユーザー</param> /// <param name="receiveUser">通知を受け取ったユーザー</param> /// <param name="type">通知の種類</param> /// <param name="parameter">文字情報等</param> /// <param name="id">対象のツイートID等</param> public static void StackNotification(User sentUser, User receiveUser, NotificationPropertiesType type, object parameter = null, long?id = null) { if (Notifications == null) { Notifications = new ObservableCollection <Notification>(); BindingOperations.EnableCollectionSynchronization(Notifications, new object()); } Notifications.Add(new Notification(sentUser, receiveUser, type, parameter, id)); }
public Notification(User sentUser, User receiveUser, NotificationPropertiesType type, object parameter = null, long?id = null) { this.NotificationPropertiesType = type; this.SentUser = new UserOverviewProperties(sentUser); this.ReceiveUser = new UserOverviewProperties(receiveUser); if (parameter is string) { this.Text = parameter as string; } if (id != null) { this.Id = (long)id; } }
public NotificationProperties(TimelineModel timelineModel, UserOverviewProperties sentUser, UserOverviewProperties receiveUser, NotificationPropertiesType type, object parameter = null, long?id = null) { this.TimelineModel = timelineModel; this.NotificationPropertiesType = type; this.SentUser = sentUser; this.ReceiveUser = receiveUser; if (parameter is string) { this.Text = parameter as string; } if (id != null) { this.Id = (long)id; } this.SelectCommand = new RelayCommand(this.Select); this.SelectSentUserCommand = new RelayCommand(this.SelectSentUser); this.SelectReceiveUserCommand = new RelayCommand(this.SelectReceiveUser); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="timelineModel"></param> /// <param name="sentUser"></param> /// <param name="receiveUser"></param> /// <param name="type"></param> /// <param name="parameter"></param> public TimelineItemProperties(TimelineModel timelineModel, UserOverviewProperties sentUser, UserOverviewProperties receiveUser, NotificationPropertiesType type, object parameter = null, long?id = null) { this.TimelineItemType = TimelineItemType.Notification; this.NotificationProperties = new NotificationProperties(timelineModel, sentUser, receiveUser, type, parameter, id); }