public void AddTablatures(HierarchyTabReferenceCollectionModel tabs) { if (tabs == null) { return; } if (tabs.Count == 0) { return; } if (Tablatures == null) { Tablatures = new HierarchyTabReferenceCollectionModel(); } Tablatures.AddRange(tabs); }
public void PopulateWithTablatures(ref HierarchyTabReferenceCollectionModel tabs) { if (tabs == null) { return; } if (tabs.Count == 0) { return; } foreach (HierarchyModel hier in this) { hier.AddTablatures(tabs.Where(x => x.Parents != null && x.Parents.Count > 0 && x.Parents.ContainsKey(hier.Id))); if (hier.HasDescendance) { hier.Descendance.PopulateWithTablatures(ref tabs); } } }