1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using Com.Piwigo.Lib.DTO; |
---|
6 | |
---|
7 | namespace 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.Categories == null) |
---|
31 | { |
---|
32 | aPwgImageWPF.Categories = new System.Collections.ObjectModel.ObservableCollection<PwgCategoryWPF>(); |
---|
33 | } |
---|
34 | else |
---|
35 | { |
---|
36 | aPwgImageWPF.Categories.Clear(); |
---|
37 | } |
---|
38 | |
---|
39 | foreach (PwgCategoryWPF c in aPwgImageWPF.Categories) |
---|
40 | { |
---|
41 | aPwgImageWPF.Categories.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 | } |
---|