Ejemplo n.º 1
0
        private void _UpdateCollection()
        {
            _filteredCollection.Merge(from album in _rawCollection where album.Owner == null || _IsOwnerInteresting(album) select album, false);

            foreach (var contact in from album in _rawCollection where album.Owner != null select album.Owner)
            {
                if (!_interestMap.ContainsKey(contact))
                {
                    _interestMap.Add(contact, _IsInteresting(contact));
                    contact.PropertyChanged += _OnContactPropertyChanged;
                }
            }
        }
Ejemplo n.º 2
0
        private void _UpdateCollection()
        {
            _filteredCollection.Merge(from contact in _rawCollection where _IsOnline(contact) select contact, false);

            foreach (var contact in _rawCollection)
            {
                if (!_onlineMap.ContainsKey(contact))
                {
                    _onlineMap.Add(contact, _IsOnline(contact));
                    contact.PropertyChanged += _OnContactPropertyChanged;
                }
            }
        }
Ejemplo n.º 3
0
        private void _UpdateCollection()
        {
            _filteredCollection.Merge(from post in _rawCollection where _IsInteresting(post.Actor) select post, false);

            foreach (var contact in from p in _rawCollection select p.Actor)
            {
                if (!_interestMap.ContainsKey(contact))
                {
                    _interestMap.Add(contact, _IsInteresting(contact));
                    contact.PropertyChanged += _OnContactPropertyChanged;
                }
            }
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
        private void _OnGetCommentsCompleted(object sender, AsyncCompletedEventArgs e)
        {
            if (e.Cancelled || e.Error != null)
            {
                return;
            }

            var response = (GetCommentsForPhotoResponse)e.UserState;

            SourceService.Dispatcher.BeginInvoke(
                (Action) delegate
            {
                CanComment = response.CanComment;
                RawComments.Merge(response.Comments, false);
                if (RawComments.Count > 0)
                {
                    FirstComment = RawComments[0];
                }
                else
                {
                    FirstComment = null;
                }
            }, null);
        }