예제 #1
0
        public void Handle(PhotoUploadedToAlbum message)
        {
            PhotoMediaListItemViewModel listItemViewModel = new PhotoMediaListItemViewModel(message.photo);

            this._cachedSources.Insert(0, listItemViewModel.ImageUri);
            this._profileData.photos.items.Insert(0, message.photo);
            this.Items.Insert(0, (MediaListItemViewModelBase)listItemViewModel);
            ++this._profileData.photos.count;
            // ISSUE: type reference
            // ISSUE: method reference
            this.NotifyPropertyChanged <int>(() => this.Count);
        }
예제 #2
0
        public void HandlePhotoDeleted(PhotoDeletedFromAlbum message)
        {
            IProfileData profileData = this._profileData;
            long         num         = profileData != null ? profileData.Id : 0L;

            if (num == 0L)
            {
                return;
            }
            if (this._isGroup)
            {
                num *= -1L;
            }
            if (message.OwnerId != num || this.Items == null)
            {
                return;
            }
            using (IEnumerator <MediaListItemViewModelBase> enumerator = this.Items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    MediaListItemViewModelBase  current           = enumerator.Current;
                    PhotoMediaListItemViewModel listItemViewModel = current as PhotoMediaListItemViewModel;
                    Photo photo = listItemViewModel != null ? listItemViewModel.Photo :  null;
                    if (photo != null && photo.id == message.PhotoId)
                    {
                        this._cachedSources.RemoveAt(this.Items.IndexOf(current));
                        this._profileData.photos.items.Remove(photo);
                        this.Items.Remove(current);
                        --this._profileData.photos.count;
                        // ISSUE: type reference
                        // ISSUE: method reference
                        this.NotifyPropertyChanged <int>(() => this.Count);
                        break;
                    }
                }
            }
        }