source: extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetImageforCategory.cs @ 11911

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

WPF inprovement

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 PwgCmdGetImageforCategory : PwgCmdBase
13    {
14        public override void Execute(object parameter)
15        {
16            PwgCategoryWPF catParam;
17            Int32 aPage = 0;
18            Int32 aPerPage = 0;
19            Int32 acount = 0;
20
21            try {
22                Uri uriServer = new Uri(PwgModelManager.Instance.Session.ServeurName);
23                if (parameter is PwgCategoryWPF)
24                {
25                    catParam = (PwgCategoryWPF)parameter;
26                    ImageCacheManager.Instance.SetCurrentCategory(catParam.Id.ToString());
27
28                    List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(catParam.Id, false, null, null, null, null, null, null, null, null, null, null, null, null, null, true, ref aPage, ref aPerPage, ref  acount);
29                    PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList;
30
31                    PwgImageListWPFHelper.ConvertPwgImageListToPwgImageListWPF(lstImg, ref lstImgWPF);
32                }
33             
34            }
35            catch (PwgServiceException ex)
36            {
37                Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr);
38                Console.WriteLine(ex.Message);
39            }
40
41        }
42    }
43}
Note: See TracBrowser for help on using the repository browser.