- Timestamp:
- Aug 12, 2011, 4:32:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgCategoryListWPFHelper.cs
r11911 r11935 34 34 aPwgCategoryListWPF = new PwgCategoryListWPF(); 35 35 } 36 36 37 foreach (PwgCategory pwgCat in aPwgCategoryList) 37 38 { … … 40 41 } 41 42 } 43 44 public static void ConvertPwgCategoryListToPwgRootCategoryWPF(List<PwgCategory> aPwgCategoryList, ref PwgRootCategoryWPF aPwgRootCategory) 45 { 46 if (aPwgCategoryList != null) 47 { 48 if ((aPwgRootCategory == null) 49 || (aPwgRootCategory.Childrens == null)) 50 { 51 throw new SystemException("The PwgCategoryListWPFHelper.InitRootCategory must be called before calling this."); 52 } 53 54 if (aPwgRootCategory.Childrens == null) 55 { 56 aPwgRootCategory.Childrens = new PwgCategoryListWPF(); 57 } 58 59 PwgCategoryListWPF aPwgCategoryListWPF = aPwgRootCategory.Childrens; 60 foreach (PwgCategory pwgCat in aPwgCategoryList) 61 { 62 AddPwgCategoryToList(pwgCat, ref aPwgCategoryListWPF); 63 } 64 } 65 } 66 67 public static void InitRootCategory () 68 { 69 if (PwgModelManager.Instance.CategoryList == null) 70 { 71 throw new SystemException("The PwgModelManager.Instance.CategoryList must be initialized from presentation tread before calling this."); 72 } 73 if (PwgModelManager.Instance.CategoryList.Count != 1) 74 { 75 PwgModelManager.Instance.CategoryList.Clear(); 76 PwgRootCategoryWPF aRootCategory = new PwgRootCategoryWPF(); 77 aRootCategory.Name = "Root"; 78 aRootCategory.Childrens = new PwgCategoryListWPF(); 79 PwgModelManager.Instance.CategoryList.Add(aRootCategory); 80 PwgModelManager.Instance.RootCategoryList = aRootCategory; 81 } 82 83 if (PwgModelManager.Instance.RootCategoryList == null) 84 { 85 PwgModelManager.Instance.RootCategoryList = PwgModelManager.Instance.CategoryList.ElementAtOrDefault(0); 86 } 87 88 } 42 89 } 43 90 }
Note: See TracChangeset
for help on using the changeset viewer.