コード例 #1
0
        public void AddTablatures(HierarchyTabReferenceCollectionModel tabs)
        {
            if (tabs == null)
            {
                return;
            }

            if (tabs.Count == 0)
            {
                return;
            }

            if (Tablatures == null)
            {
                Tablatures = new HierarchyTabReferenceCollectionModel();
            }

            Tablatures.AddRange(tabs);
        }
コード例 #2
0
        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);
                }
            }
        }