source: extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetSubAlbumforAlbum.cs @ 12336

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

rename category to Albums

File size: 1.5 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 PwgCmdGetSubAlbumforAlbum : AsyncCommand
13    {
14        public override string Text { get { return "Get sub-Albums for a Album"; } }
15
16        protected override void OnExecute(object parameter)
17        {
18            PwgAlbumWPF catParam;
19            try
20            {
21                if (parameter is PwgAlbumWPF)
22                {
23                    PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList;
24                    catParam = (PwgAlbumWPF)parameter;
25
26                    SendUiInfo("Retriving Album list from server...");
27                    List<PwgAlbum> lstCat = PwgServiceProvider.Instance.PwgAlbumsService.GetListOfAlbum(catParam.Id, null, null);
28                    if (catParam.Childrens == null)
29                    {
30                        catParam.Childrens = new PwgAlbumListWPF();
31                    }
32                    PwgAlbumListWPF lstCatWPF = catParam.Childrens;
33
34                    PwgAlbumListWPFHelper.ConvertPwgAlbumListToPwgAlbumListWPF(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.