source: extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgTagListWPFHelper.cs @ 12015

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

retrieve tags list and image for a tag.

File size: 1.3 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 PwgTagListWPFHelper
10    {
11        public static void AddPwgTagToList(PwgTag aPwgCategory,
12                                           ref PwgTagListWPF aPwgCategoryListWPF)
13        {
14            if (aPwgCategory != null)
15            {
16                if (aPwgCategoryListWPF == null)
17                {
18                    aPwgCategoryListWPF = new PwgTagListWPF();
19                }
20
21                PwgTagWPF pwgTag = new PwgTagWPF();
22                PwgTagWPFHelper.ConvertPwgTagToPwgTagWPF(aPwgCategory, ref pwgTag);
23
24                aPwgCategoryListWPF.Add(pwgTag);
25            }
26        }
27
28        public static void ConvertPwgTagListToPwgTagListWPF(List<PwgTag> aPwgTagList, ref PwgTagListWPF aPwgTagListWPF)
29        {
30            if (aPwgTagList != null)
31            {
32                if (aPwgTagListWPF == null)
33                {
34                    aPwgTagListWPF = new PwgTagListWPF();
35                }
36
37                foreach (PwgTag pwgTag in aPwgTagList)
38                {
39                    AddPwgTagToList(pwgTag, ref aPwgTagListWPF);
40                }
41            }
42        }
43    }
44}
Note: See TracBrowser for help on using the repository browser.