private ObservableCollection <MModule> createTreeViewItemsTree(ArrayList items) { String prevKey = ""; ObservableCollection <MModule> oitems = new ObservableCollection <MModule>(); string[] stringSeparators = new string[] { "_" }; MModule gp = null; foreach (CTable t in items) { String perm = t.GetFieldValue("PERM_NAME"); string[] result = perm.Split(stringSeparators, StringSplitOptions.None); String key = result[0]; if (!prevKey.Equals(key)) { gp = new MModule(t); gp.ModuleName = key; oitems.Add(gp); prevKey = key; } MGroupPermission pm = new MGroupPermission(t); gp.AddGroupPermission(pm); } return(oitems); }
public void AddGroupPermission(MGroupPermission pm) { items.Add(pm); }