Esempio n. 1
0
        private void _OnGetCommentsCompleted(object sender, AsyncCompletedEventArgs args)
        {
            var comments = (IEnumerable <ActivityComment>)args.UserState;

            RawComments.Merge(comments, false);
            CommentCount = RawComments.Count;
            _NotifyPropertyChanged("CommentCount");
            _NotifyPropertyChanged("HasMoreComments");
            _gettingMoreComments = false;
        }
Esempio n. 2
0
        void IMergeable <FacebookObjectId, ActivityPost> .Merge(ActivityPost other)
        {
            Verify.IsNotNull(other, "other");
            Verify.AreEqual(PostId, other.PostId, "other", "Can't merge two ActivityPosts with different Ids.");

            if (object.ReferenceEquals(this, other))
            {
                return;
            }

            Assert.AreEqual(ActorUserId, other.ActorUserId);
            //ActorUserId = other.ActorUserId;
            Assert.AreEqual(TargetUserId, other.TargetUserId);
            //TargetUserId = other.TargetUserId;

            Attachment        = other.Attachment;
            CanComment        = other.CanComment;
            CanLike           = other.CanLike;
            CanRemoveComments = other.CanRemoveComments;
            CommentCount      = other.CommentCount;
            Created           = other.Created;
            HasLiked          = other.HasLiked;
            LikedCount        = other.LikedCount;
            LikeUri           = other.LikeUri;
            Message           = other.Message;
            RawComments.Merge(other.RawComments, false);
            if (_hasGottenMoreComments)
            {
                GetMoreComments();
            }
            else
            {
                _NotifyPropertyChanged("HasMoreComments");
            }

            if (other._mergeableLikers != null && other._mergeableLikers.Count != 0)
            {
                if (this._mergeableLikers == null)
                {
                    _mergeableLikers = new FBMergeableCollection <FacebookContact>(false);
                }
                _mergeableLikers.Merge(other._mergeableLikers, false);
            }
            else if (_mergeableLikers != null)
            {
                _mergeableLikers.Clear();
            }

            Updated = other.Updated;
        }