internal Dictionary(string name, string caption, bool raiseBitwise, ItemValueDataType valueDataType, string description, DictionaryItemCollection items) { this.name = name; this.caption = caption; this.raiseBitwise = raiseBitwise; this.itemValueDataType = valueDataType; this.description = description; this.items = items; List<DictionaryItem> list = new List<DictionaryItem>(this.items.Count); this.AppendItemsToList(null, this.items, list); this.all = new DictionaryItemCollection(list); }
private void AppendItemsToList(DictionaryItem parent, DictionaryItemCollection items, List<DictionaryItem> list) { if (items.Count > 0) { int childLevel = parent == null ? 1 : parent.level + 1; if(childLevel>this.levelsCount) { this.levelsCount = childLevel; } DictionaryItem child; for (int i = 0; i < items.Count; i++) { child = items[i]; child.level = childLevel; list.Add(child); AppendItemsToList(child, child.Children, list); } } }
internal void SetRelation(DictionaryItem parent, DictionaryItemCollection children) { this.parent = parent; this.children = children; }