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

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

rename category to Albums

File size: 2.0 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 PwgImageWPFHelper
10    {
11        public static void ConvertPwgImageToPwgImageWPF(PwgImage aPwgImage,
12                                                       ref PwgImageWPF aPwgImageWPF)
13        {
14            if (aPwgImage != null)
15            {
16                if (aPwgImageWPF == null)
17                {
18                    aPwgImageWPF = new PwgImageWPF();
19                }
20
21                aPwgImageWPF.Id = aPwgImage.Id;
22                aPwgImageWPF.Counter = aPwgImage.Counter;
23                aPwgImageWPF.File = aPwgImage.File;
24                aPwgImageWPF.Height = aPwgImage.Height;
25                aPwgImageWPF.UrlElement = aPwgImage.UrlElement;
26                aPwgImageWPF.UrlHighDef = aPwgImage.UrlHighDef;
27                aPwgImageWPF.UrlThunb = aPwgImage.UrlThunb;
28                aPwgImageWPF.Width = aPwgImage.Width;
29
30                if (aPwgImageWPF.Albums == null)
31                {
32                    aPwgImageWPF.Albums = new System.Collections.ObjectModel.ObservableCollection<PwgAlbumWPF>();
33                }
34                else
35                {
36                    aPwgImageWPF.Albums.Clear();
37                }
38
39                foreach (PwgAlbumWPF c in aPwgImageWPF.Albums)
40                {
41                    aPwgImageWPF.Albums.Add(c);
42                }
43
44                //if (aPwgImageWPF.Tags == null)
45                //{
46                //    aPwgImageWPF.Tags = new System.Collections.ObjectModel.ObservableCollection<PwgTag>();
47                //}
48                //else
49                //{
50                //    aPwgImageWPF.Tags.Clear();
51                //}
52
53                //foreach (PwgTag t in aPwgImageWPF.Tags)
54                //{
55                //    aPwgImageWPF.Tags.Add(t);
56                //}
57
58            }
59
60        }
61    }
62}
Note: See TracBrowser for help on using the repository browser.