source: extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetSubCategorieforCategory.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.6 KB
Line 
1using System;
2using System.Collections.Generic;
3using Com.Piwigo.Lib.IService;
4using Com.Piwigo.Wpf.DTO;
5using Com.Piwigo.Lib.DTO;
6using Com.Piwigo.Wpf.DTO.Helper;
7using Com.Piwigo.Wpf.Helper;
8using Com.Piwigo.Wpf.Service;
9
10namespace Com.Piwigo.Wpf.Command
11{
12    public sealed class PwgCmdGetSubCategorieforCategory : AsyncCommand
13    {
14        public override string Text { get { return "Get sub-categories for a category"; } }
15
16        protected override void OnExecute(object parameter)
17        {
18            PwgCategoryWPF catParam;
19            try
20            {
21                if (parameter is PwgCategoryWPF)
22                {
23                    PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList;
24                    catParam = (PwgCategoryWPF)parameter;
25
26                    SendUiInfo("Retriving Category list from server...");
27                    List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfCategory(catParam.Id, null, null);
28                    if (catParam.Childrens == null)
29                    {
30                        catParam.Childrens = new PwgCategoryListWPF();
31                    }
32                    PwgCategoryListWPF lstCatWPF = catParam.Childrens;
33
34                    PwgCategoryListWPFHelper.ConvertPwgCategoryListToPwgCategoryListWPF(lstCat, ref lstCatWPF);
35                    catParam.IsExpanded = true;
36                }
37            }
38            catch (PwgServiceException ex)
39            {
40                SendUiInfo("Error " + ex.NumeroErr + " " + ex.MessageErr);
41            }
42        }
43    }
44}
Note: See TracBrowser for help on using the repository browser.