Line | |
---|
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 PwgCategoryWPFHelper |
---|
10 | { |
---|
11 | public static void ConvertPwgCategoryToPwgCategoryWPF(PwgCategory aPwgCategory, |
---|
12 | ref PwgCategoryWPF aPwgCategoryWPF) |
---|
13 | { |
---|
14 | if (aPwgCategory != null) |
---|
15 | { |
---|
16 | if (aPwgCategoryWPF == null) |
---|
17 | { |
---|
18 | aPwgCategoryWPF = new PwgCategoryWPF(); |
---|
19 | } |
---|
20 | aPwgCategoryWPF.DeepImagesCount = aPwgCategory.DeepImagesCount; |
---|
21 | aPwgCategoryWPF.Id = aPwgCategory.Id; |
---|
22 | aPwgCategoryWPF.ImagesCount = aPwgCategory.ImagesCount; |
---|
23 | aPwgCategoryWPF.LastDate = aPwgCategory.LastDate; |
---|
24 | aPwgCategoryWPF.Name = aPwgCategory.Name; |
---|
25 | aPwgCategoryWPF.SubCategoriesCount = aPwgCategory.SubCategoriesCount; |
---|
26 | aPwgCategoryWPF.Url = aPwgCategory.Url; |
---|
27 | |
---|
28 | if (aPwgCategoryWPF.UpperCategoriesId == null) |
---|
29 | { |
---|
30 | aPwgCategoryWPF.UpperCategoriesId = new System.Collections.ObjectModel.ObservableCollection<int>(); |
---|
31 | } |
---|
32 | else |
---|
33 | { |
---|
34 | aPwgCategoryWPF.UpperCategoriesId.Clear(); |
---|
35 | } |
---|
36 | |
---|
37 | foreach (int i in aPwgCategory.UpperCategoriesId) |
---|
38 | { |
---|
39 | aPwgCategoryWPF.UpperCategoriesId.Add(i); |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.