Changeset 7160 for extensions/PiwigoLib/PiwigoWpf/Command
- Timestamp:
- Oct 11, 2010, 8:04:34 PM (14 years ago)
- Location:
- extensions/PiwigoLib/PiwigoWpf/Command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs
r7150 r7160 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Windows.Input; 3 using Com.Piwigo.Lib.IService; 4 using Com.Piwigo.Wpf.DTO; 5 using Com.Piwigo.Lib.DTO; 6 using Com.Piwigo.Wpf.DTO.Helper; 7 using Com.Piwigo.Wpf.Helper; 6 8 7 9 namespace Com.Piwigo.Wpf.Command … … 11 13 public override bool CanExecute(object parameter) 12 14 { 13 return true; 15 Boolean retVal = false; 16 if ( AppHelper.IsInDesignModeStatic == true) 17 { 18 retVal = false; 19 } 20 else 21 { 22 if ((PwgModelManager.Instance.Session != null) 23 & (PwgModelManager.Instance.Session.ServeurName != null)) 24 { 25 retVal = !String.IsNullOrWhiteSpace(PwgModelManager.Instance.Session.ServeurName); 26 } 27 } 28 return (retVal); 14 29 } 15 30 16 31 public override void Execute(object parameter) 17 32 { 18 throw new NotImplementedException(); 33 try { 34 Uri uriServer = new Uri(PwgModelManager.Instance.Session.ServeurName); 35 36 PwgServiceProvider.Instance.PwgSetupService.Setup(null, null, uriServer); 37 PwgSession sess = PwgServiceProvider.Instance.PwgSessionService.GetPwgSession(); 38 sess = PwgServiceProvider.Instance.PwgSessionService.Login( PwgModelManager.Instance.Session.UserName, 39 PwgModelManager.Instance.Session.Password); 40 41 PwgSessionWPF sesWPF = PwgModelManager.Instance.Session; 42 PwgSessionWPFHelper.AddPwgSessionInfoToPwgSessionWPF(sess, ref sesWPF); 43 44 List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfCategory(null, false, (PwgModelManager.Instance.Session.Status == PwgSessionStatusEnum.Guest)); 45 PwgCategoryListWPF lstCatWPF = PwgModelManager.Instance.CategoryList; 46 47 PwgCategoryListWPFHelper.ConvertPwgCategoryListToPwgCategoryListWPF(lstCat, ref lstCatWPF); 48 } 49 catch (PwgServiceException ex) 50 { 51 Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr); 52 Console.WriteLine(ex.Message); 53 } 54 19 55 } 20 56 } -
extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdProvider.cs
r7150 r7160 7 7 namespace Com.Piwigo.Wpf.Command 8 8 { 9 public static sealedclass PwgCmdProvider9 public static class PwgCmdProvider 10 10 { 11 11 public static ICommand _pwgCmdConnect;
Note: See TracChangeset
for help on using the changeset viewer.