public void NotifyRetweeted(TwitterUser source, TwitterStatus original, TwitterStatus retweet)
 {
     if (!_proxy.NotifyRetweeted(source, original, retweet) && this.Next != null)
     {
         this.Next.NotifyRetweeted(source, original, retweet);
     }
 }
 public void NotifyUnblocked(TwitterUser source, TwitterUser target)
 {
     if (!_proxy.NotifyUnblocked(source, target) && this.Next != null)
     {
         this.Next.NotifyUnblocked(source, target);
     }
 }
 public void NotifyUnfavorited(TwitterUser source, TwitterStatus status)
 {
     if (!_proxy.NotifyUnfavorited(source, status) && this.Next != null)
     {
         this.Next.NotifyUnfavorited(source, status);
     }
 }
Ejemplo n.º 4
0
 public void NotifyUnblocked(TwitterUser source, TwitterUser target)
 {
     if (Next != null)
     {
         Next.NotifyUnblocked(source, target);
     }
 }
Ejemplo n.º 5
0
 public void NotifyRetweeted(TwitterUser source, TwitterStatus status)
 {
     if (Next != null)
     {
         Next.NotifyRetweeted(source, status);
     }
 }
Ejemplo n.º 6
0
 public void NotifyFavorited(TwitterUser source, TwitterStatus status)
 {
     if (!_proxy.NotifyFavorited(source, status))
     {
         Next?.NotifyFavorited(source, status);
     }
 }
Ejemplo n.º 7
0
 public void NotifyRetweeted(TwitterUser source, TwitterStatus status)
 {
     if (_proxy.NotifyRetweeted(source, status) && this.Next != null)
     {
         this.Next.NotifyRetweeted(source, status);
     }
 }
Ejemplo n.º 8
0
 public void NotifyUnmuted(TwitterUser source, TwitterUser target)
 {
     if (!_proxy.NotifyUnmuted(source, target))
     {
         Next?.NotifyUnmuted(source, target);
     }
 }
Ejemplo n.º 9
0
 public void NotifyFollowed(TwitterUser source, TwitterUser target)
 {
     if (_proxy.NotifyFollowed(source, target) && this.Next != null)
     {
         this.Next.NotifyFollowed(source, target);
     }
 }
Ejemplo n.º 10
0
 public void NotifyRetweeted(TwitterUser source, TwitterStatus original, TwitterStatus retweet)
 {
     if (Setting.Accounts.Contains(source.Id) ||
         Setting.Accounts.Contains(original.User.Id))
     {
         BackstageModel.RegisterEvent(new RetweetedEvent(source, original));
     }
 }
Ejemplo n.º 11
0
 public UserViewModel(TwitterUser user)
 {
     this.Model = UserModel.Get(user);
     this.CompositeDisposable.Add(new CompositeDisposable(
         new EventListener<Action<TimelineIconResolution>>(
             h => Setting.IconResolution.ValueChanged += h,
             h => Setting.IconResolution.ValueChanged -= h,
             _ => this.RaisePropertyChanged(() => ProfileImageUriOptimized))));
 }
Ejemplo n.º 12
0
 public RelationControlViewModel(UserInfoViewModel parent, TwitterAccount source, TwitterUser target)
 {
     this._parent = parent;
     this._source = source;
     this._target = target;
     var rds = source.RelationData;
     this.IsFollowing = rds.IsFollowing(target.Id);
     this.IsFollowedBack = rds.IsFollowedBy(target.Id);
     this.IsBlocking = rds.IsBlocking(target.Id);
     Task.Run(() => this.GetFriendship(rds));
 }
Ejemplo n.º 13
0
 public BackstageAccountModel(TwitterAccount account)
 {
     this._account = account;
     this.UpdateConnectionState();
     StoreHelper.GetUser(this._account.Id)
         .Subscribe(
             u =>
             {
                 _user = u;
                 this.RaiseTwitterUserChanged();
             },
             ex => BackstageModel.RegisterEvent(
                 new OperationFailedEvent("アカウント情報を取得できません(@" + _account.UnreliableScreenName + ")", ex)));
 }
Ejemplo n.º 14
0
 public BackstageAccountModel(TwitterAccount account)
 {
     this._account = account;
     this.UpdateConnectionState();
     StoreHelper.GetUser(this._account.Id)
                .Subscribe(
                    u =>
                    {
                        _user = u;
                        this.OnTwitterUserChanged();
                    },
                    ex => BackstageModel.RegisterEvent(
                        new OperationFailedEvent("Could not receive user account: " +
                                                 this._account.UnreliableScreenName +
                                                 " - " + ex.Message)));
 }
Ejemplo n.º 15
0
 public TwitterList(dynamic json)
 {
     Id       = Int64.Parse(json.id_str);
     User     = new TwitterUser(json.user);
     Name     = json.name;
     FullName = json.full_name;
     Uri      = new Uri(TwitterListUriPrefix + json.uri);
     Slug     = json.slug;
     ListMode = String.Equals(json.mode, "public", StringComparison.InvariantCultureIgnoreCase)
                    ? ListMode.Public
                    : ListMode.Private;
     Description     = json.description;
     MemberCount     = (long)json.member_count;
     SubscriberCount = (long)json.subscriber_count;
     CreatedAt       = ((string)json.created_at).ParseDateTime(ParsingExtension.TwitterDateTimeFormat);
 }
Ejemplo n.º 16
0
 public TwitterList(dynamic json)
 {
     Id = Int64.Parse(json.id_str);
     User = new TwitterUser(json.user);
     Name = json.name;
     FullName = json.full_name;
     Uri = new Uri(TwitterListUriPrefix + json.uri);
     Slug = json.slug;
     ListMode = String.Equals(json.mode, "public", StringComparison.InvariantCultureIgnoreCase)
                    ? ListMode.Public
                    : ListMode.Private;
     Description = json.description;
     MemberCount = (long)json.member_count;
     SubscriberCount = (long)json.subscriber_count;
     CreatedAt = ((string)json.created_at).ParseDateTime(ParsingExtension.TwitterDateTimeFormat);
 }
Ejemplo n.º 17
0
 public BackstageAccountModel(TwitterAccount account)
 {
     this._account = account;
     this.UpdateConnectionState();
     StoreHelper.GetUser(this._account.Id)
                .Subscribe(
                    u =>
                    {
                        _user = u;
                        this.RaiseTwitterUserChanged();
                    },
                    ex => BackstageModel.RegisterEvent(new OperationFailedEvent(
                        BackstageResources.GetAccountInfoFailedFormat.SafeFormat(
                            "@" + _account.UnreliableScreenName),
                        ex)));
 }
 public BackstageAccountModel(TwitterAccount account)
 {
     this._account = account;
     this.UpdateConnectionState();
     Task.Run(async () =>
     {
         try
         {
             _user = await StoreHelper.GetUserAsync(this._account.Id);
             this.RaiseTwitterUserChanged();
         }
         catch (Exception ex)
         {
             BackstageModel.RegisterEvent(new OperationFailedEvent(
                 BackstageResources.GetAccountInfoFailedFormat.SafeFormat("@" + _account.UnreliableScreenName),
                 ex));
         }
     });
 }
Ejemplo n.º 19
0
 public void NotifyUserUpdated(TwitterUser source)
 {
     // do nothing, currently.
 }
Ejemplo n.º 20
0
 public void NotifyUnfavorited(TwitterUser source, TwitterStatus status)
 {
     BackstageModel.RegisterEvent(new UnfavoritedEvent(source, status));
 }
Ejemplo n.º 21
0
 public void NotifyUnmuted(TwitterUser source, TwitterUser target)
 {
     BackstageModel.RegisterEvent(new UnmutedEvent(source, target));
 }
 static void Instance_OnRetweeted(TwitterUser arg1, TwitterStatus arg2)
 {
     Show(new NormalNotificatorViewModel(MetroColors.Emerald,
         arg1, "retweeted", arg2.ToString()));
 }
 static void Instance_OnUserFollowed(TwitterUser arg1, TwitterUser arg2)
 {
     Show(new NormalNotificatorViewModel(MetroColors.Cobalt,
         arg1, "followed", "@" + arg2.ScreenName + Environment.NewLine + arg2.Name));
 }
Ejemplo n.º 24
0
 internal static void NotifyUserUpdated(TwitterUser source)
 {
     Head.NotifyUserUpdated(source);
 }
Ejemplo n.º 25
0
 public TwitterStatus([NotNull] TwitterUser user, [NotNull] string text)
 {
     this.GenerateFromJson = false;
     this.User             = user;
     this.Text             = text;
 }
Ejemplo n.º 26
0
 public TwitterStatus([@CanBeNull] TwitterUser user, [@CanBeNull] string text)
 {
     GenerateFromJson = false;
     User             = user;
     Text             = text;
 }
Ejemplo n.º 27
0
        public async void AddRetweetedUser(TwitterUser user)
        {
            if (Status.RetweetedOriginal != null)
            {
                var status = await Get(Status.RetweetedOriginal).ConfigureAwait(false);
                status.AddRetweetedUser(user);
            }
            else
            {
                var added = false;
                lock (_retweetedsLock)
                {
                    if (!_retweetedUsersDic.ContainsKey(user.Id))
                    {
                        _retweetedUsersDic.Add(user.Id, user);
                        Status.RetweetedUsers = Status.RetweetedUsers.Guard()
                                                      .Append(user.Id)
                                                      .Distinct()
                                                      .ToArray();
                        added = true;
                    }
                }
                if (added)
                {
                    _retweetedUsers.Add(user);
#pragma warning disable 4014
                    StatusProxy.AddRetweeter(Status.Id, user.Id);
                    StatusBroadcaster.Republish(this);
#pragma warning restore 4014
                }
            }
        }
Ejemplo n.º 28
0
 public UnknownEvent(TwitterUser source, string evstr)
     : base(source, source)
 {
     _evstr = evstr;
 }
Ejemplo n.º 29
0
 public static void SetTwitterUser(DependencyObject obj, TwitterUser value)
 {
     obj.SetValue(TwitterUserProperty, value);
 }
 static void Instance_OnFavorited(TwitterUser arg1, TwitterStatus arg2)
 {
     Show(new NormalNotificatorViewModel(MetroColors.Amber,
         arg1, "favorited", arg2.ToString()));
 }
Ejemplo n.º 31
0
 public RetweetedEvent(TwitterUser source, TwitterStatus target)
     : base(source, target) { }
        public NormalNotificatorViewModel(
            Color background, TwitterUser user, string header, string description)
        {
            this._background = background;
            this._user = user;
            this._header = header;
            this._description = description;
            // acquire slot
            lock (Slots)
            {
                _slotIndex = 0;
                while (_slotIndex < Slots.Count)
                {
                    if (!Slots[_slotIndex]) break;
                    _slotIndex++;
                }
                if (_slotIndex < Slots.Count)
                {
                    Slots[_slotIndex] = true;
                }
                else
                {
                    Slots.Add(true);
                }
            }
            var screen = NotificationUtil.GetNotifyTargetScreen();
            if (screen == null) return;
            var bound = screen.WorkingArea;
            // size of notificator
            const int wh = 80;
            const int ww = 300;

            // items per one (vertical) line
            var ipl = (int)Math.Ceiling(bound.Height / wh);

            if (ipl == 0)
            {
                // can not place any dialog
                return;
            }

            _left = (int)((bound.Width - ww * (this._slotIndex / ipl + 1)) + bound.Left);
            _top = (int)((bound.Height - wh * (this._slotIndex % ipl + 1)) + bound.Top);
            System.Diagnostics.Debug.WriteLine("#N - " + _slotIndex + " / " + _left + ", " + _top);
        }
Ejemplo n.º 33
0
 public UserViewModel(TwitterUser user)
 {
     this.Model = UserModel.Get(user);
 }