Beispiel #1
0
        public async void AddRetweetedUser(TwitterUser user)
        {
            if (Status.RetweetedStatus != null)
            {
                var status = await Get(Status.RetweetedStatus).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
                }
            }
        }
Beispiel #2
0
 private StatusModel(TwitterStatus status)
 {
     Status = status;
     Task.Run(() =>
     {
         foreach (var image in ImageResolver.ResolveImages(status))
         {
             _thumbnails.Add(new ThumbnailImage(image));
         }
     });
 }
Beispiel #3
0
        public void ClearInput(string text, bool sendDraftIfChanged)
        {
            var current = _inputData;

            _inputData = new InputData(text);
            if (current.IsChanged && sendDraftIfChanged)
            {
                // if text is not changed, send to draft
                _drafts.Add(current);
            }
            _inputData.BoundTags = BindingHashtags.ToArray();
            RaisePropertyChanged(() => CurrentInputData);
        }
Beispiel #4
0
 /// <summary>
 ///     Create column
 /// </summary>
 /// <param name="info">initial created tab</param>
 public static void CreateColumn(params TabModel[] info)
 {
     _columns.Add(new ColumnModel(info));
     CurrentFocusColumnIndex = _columns.Count - 1;
     Save();
 }