source: extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgCategoryWPFHelper.cs @ 7160

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

Connection à partir de wpf

File size: 1.6 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 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.