Exemplo n.º 1
0
 public void LoadShops()
 {
     if (!LoadShopsWorker.IsBusy)
     {
         LoadShopsWorker.RunWorkerAsync();
     }
 }
Exemplo n.º 2
0
        private void LoadShopsWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(delegate { Mouse.OverrideCursor = Cursors.Wait; }), null);
            Application.Current.Dispatcher.BeginInvoke(new Action(delegate { Shops.Clear(); }), null);

            IsBusy      = true;
            LoadingStep = "Chargement des boutiques ...";

            Model.Prestashop.PsShopRepository PsShopRepository = new Model.Prestashop.PsShopRepository();

            foreach (var shop in PsShopRepository.List())
            {
                if (shop.IDShop == Global.CurrentShop.IDShop)
                {
                    LoadShopsWorker.ReportProgress(0, shop);
                }
            }
        }