private void LoadTypTree(DataCollection<TreeEntryClass> _typTree) { foreach (DataRow RootDataTemplateRow in DataModell.DataSetForStaticTables.Tables["RootDataTemplates"].Rows) { RootDataTemplates RootTyp = new RootDataTemplates(RootDataTemplateRow); _typTree.Add(new TreeEntryClass() { Parent = null, HeadLine = RootTyp.NameID, ConnectedObject = RootTyp }); foreach (DataRow TypRow in DataModell.DataSetForStaticTables.Tables["Typ"].Rows) { if (((Guid)TypRow["RootFormat"]) != RootTyp.ID) continue; Typ SelectableTyp = new Typ(TypRow); _typTree.Last().Childs.Add(new TreeEntryClass() { Parent = _typTree.Last(), HeadLine = SelectableTyp.NameID, ConnectedObject = SelectableTyp }); } } }
//private Dictionary<Guid,DataCollection<FullUseForTyp>> _availableFullTypForTypOrRoot; //public Dictionary<Guid, DataCollection<FullUseForTyp>> AvailableFullTypForTypOrRoot // { // get // { // if (_availableFullTypForTypOrRoot == null) // _availableFullTypForTypOrRoot = new Dictionary<Guid, DataCollection<FullUseForTyp>>(); // if (Profile.ActiveTyp != null) // { // if (!_availableFullTypForTypOrRoot.ContainsKey(Profile.ActiveTyp.ID)) // _availableFullTypForTypOrRoot[Profile.ActiveTyp.ID] = LoadAvailableFullTypForTyp(Profile.ActiveTyp); // } // else // { // if (Profile.ActiveRootDataTemplates != null) // { // if (!_availableFullTypForTypOrRoot.ContainsKey(Profile.ActiveRootDataTemplates.ID)) // _availableFullTypForTypOrRoot[Profile.ActiveRootDataTemplates.ID] = LoadAvailableFullTypForRoot(Profile.ActiveRootDataTemplates); // } // } // return _availableFullTypForTypOrRoot; // } // set { SetProperty (ref _availableFullTypForTypOrRoot, value); } // } private DataCollection<FullUseForTyp> LoadAvailableFullTypForRoot(RootDataTemplates RootToSearchFor) { DataCollection<FullUseForTyp> Result = new DataCollection<FullUseForTyp>(); foreach (FullUseForTyp Entry in AvailableFullTyp.Values) { if (Entry.ConnectedID == RootToSearchFor.ID) Result.Add(Entry); } return Result; }