source: extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgAlbumWPFHelper.cs @ 12336

Last change on this file since 12336 was 12336, checked in by bayral, 13 years ago

rename category to Albums

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Com.Piwigo.Lib.DTO;
6
7namespace Com.Piwigo.Wpf.DTO.Helper
8{
9    public static class PwgAlbumWPFHelper
10    {
11        public static void ConvertPwgAlbumToPwgAlbumWPF(PwgAlbum aPwgAlbum,
12                                                       ref PwgAlbumWPF aPwgAlbumWPF)
13        {
14            if (aPwgAlbum != null)
15            {
16                if (aPwgAlbumWPF == null)
17                {
18                    aPwgAlbumWPF = new PwgAlbumWPF();
19                }
20                aPwgAlbumWPF.DeepImagesCount = aPwgAlbum.DeepImagesCount;
21                aPwgAlbumWPF.Id = aPwgAlbum.Id;
22                aPwgAlbumWPF.ImagesCount = aPwgAlbum.ImagesCount;
23                aPwgAlbumWPF.LastDate = aPwgAlbum.LastDate;
24                aPwgAlbumWPF.Name = aPwgAlbum.Name;
25                aPwgAlbumWPF.SubAlbumsCount = aPwgAlbum.SubAlbumsCount;
26                aPwgAlbumWPF.Url = aPwgAlbum.Url;
27
28                if (aPwgAlbumWPF.UpperAlbumsId == null)
29                {
30                    aPwgAlbumWPF.UpperAlbumsId = new System.Collections.ObjectModel.ObservableCollection<Int32>();
31                }
32                else
33                {
34                    aPwgAlbumWPF.UpperAlbumsId.Clear();
35                }
36
37                foreach (Int32 i in aPwgAlbum.UpperAlbumsId)
38                {
39                    aPwgAlbumWPF.UpperAlbumsId.Add(i);
40                }
41            }
42
43        }
44    }
45}
Note: See TracBrowser for help on using the repository browser.