Beispiel #1
0
        internal void AddOrUpdateAlbum(Album createdOrUpdatedAlbum)
        {
            Func <AlbumHeader, bool> _9__1 = null;

            Execute.ExecuteOnUIThread(delegate
            {
                AlbumHeader albumHeader = this.FindByAlbumId(createdOrUpdatedAlbum.aid);
                if (albumHeader != null)
                {
                    albumHeader.Album = createdOrUpdatedAlbum;
                    albumHeader.ReadDataFromAlbumField();
                    IEnumerable <AlbumHeader> arg_5B_0 = this.EditAlbumsVM.Collection;
                    Func <AlbumHeader, bool> arg_5B_1;
                    if ((arg_5B_1 = _9__1) == null)
                    {
                        arg_5B_1 = (_9__1 = ((AlbumHeader ah) => ah.AlbumId == createdOrUpdatedAlbum.aid));
                    }
                    AlbumHeader albumHeader2 = Enumerable.FirstOrDefault <AlbumHeader>(arg_5B_0, arg_5B_1);
                    if (albumHeader2 != null)
                    {
                        albumHeader2.Album = createdOrUpdatedAlbum;
                        albumHeader2.ReadDataFromAlbumField();
                        return;
                    }
                }
                else
                {
                    AlbumHeader albumHeader3 = new AlbumHeader
                    {
                        AlbumType = AlbumType.NormalAlbum,
                        Album     = createdOrUpdatedAlbum
                    };
                    albumHeader3.ImageUri = (albumHeader3.ImageUriSmall = "https://vk.com/images/m_noalbum.png");
                    albumHeader3.ReadDataFromAlbumField();
                    this.EditAlbumsVM.Insert(albumHeader3, 0);
                    if (this.AlbumsVM.Collection.Count > 1)
                    {
                        this.AlbumsVM.Collection[1].Insert(0, albumHeader3);
                    }
                    else
                    {
                        GenericCollectionViewModel <AlbumsData, Group <AlbumHeader> > arg_130_0 = this.AlbumsVM;
                        string arg_116_0            = PhotosMainViewModel.FormatAlbumsCount(1);
                        List <AlbumHeader> expr_10E = new List <AlbumHeader>();
                        expr_10E.Add(albumHeader3);
                        arg_130_0.Insert(new Group <AlbumHeader>(arg_116_0, expr_10E, false), this.AlbumsVM.Collection.Count);
                    }
                    this.UpdateAlbums();
                    this.UpdateAlbumsCount();
                    if (!this._inAlbumCreatedHandler)
                    {
                        EventAggregator.Current.Publish(new PhotoAlbumCreated
                        {
                            Album       = createdOrUpdatedAlbum,
                            EventSource = this.GetHashCode()
                        });
                    }
                }
            });
        }
Beispiel #2
0
 public string GetFooterTextForCount(GenericCollectionViewModel <AlbumsData, AlbumHeader> caller, int count)
 {
     return(PhotosMainViewModel.GetAlbumsTextForCount(count));
 }
Beispiel #3
0
 private void UpdateAlbumsCount()
 {
     if (((Collection <Group <AlbumHeader> >) this.AlbumsVM.Collection).Count < 2)
     {
         return;
     }
     ((Collection <Group <AlbumHeader> >) this.AlbumsVM.Collection)[1].Title = PhotosMainViewModel.FormatAlbumsCount(((Collection <AlbumHeader>)((Collection <Group <AlbumHeader> >) this.AlbumsVM.Collection)[1]).Count);
 }