Ignore:
Timestamp:
Aug 8, 2011, 6:57:56 PM (13 years ago)
Author:
bayral
Message:

Async image thumbail retriving

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetImageforCategory.cs

    r11911 r11922  
    1010namespace Com.Piwigo.Wpf.Command
    1111{
    12     public sealed class PwgCmdGetImageforCategory : PwgCmdBase
     12    public sealed class PwgCmdGetImageforCategory : AsyncCommand
    1313    {
    14         public override void Execute(object parameter)
     14        public override string Text { get { return "Get images for a category"; } }
     15
     16        protected override void OnExecute(object parameter)
    1517        {
    1618            PwgCategoryWPF catParam;
     
    1921            Int32 acount = 0;
    2022
    21             try {
     23            try
     24            {
    2225                Uri uriServer = new Uri(PwgModelManager.Instance.Session.ServeurName);
    2326                if (parameter is PwgCategoryWPF)
    2427                {
     28                    PwgImageListWPF lstImgWPF = PwgModelManager.Instance.ImageList;
     29                    SendUiInfo("Removing image...");
     30                    if (lstImgWPF != null)
     31                    {
     32                        lstImgWPF.Clear();
     33                    }
     34
    2535                    catParam = (PwgCategoryWPF)parameter;
     36                    SendUiInfo("Setting up cache data...");
    2637                    ImageCacheManager.Instance.SetCurrentCategory(catParam.Id.ToString());
    2738
     39                    SendUiInfo("Retriving images list from server...");
    2840                    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 
     41                   
    3142                    PwgImageListWPFHelper.ConvertPwgImageListToPwgImageListWPF(lstImg, ref lstImgWPF);
    3243                }
    33              
    3444            }
    3545            catch (PwgServiceException ex)
    3646            {
    37                 Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr);
    38                 Console.WriteLine(ex.Message);
     47                SendUiInfo("Error " + ex.NumeroErr + " " + ex.MessageErr);
    3948            }
    40 
    4149        }
    4250    }
Note: See TracChangeset for help on using the changeset viewer.