public Element(SerializableElementNode node, List <Element> srcChildElements) #endif { id = node.id; depth = node.depth; name = node.name; extension = node.extension; path = node.path; guid = node.guid; type = node.type; icon = node.icon; findPath = node.findPath; directory = node.directory; reference = node.reference; localId = node.localId; childElements = srcChildElements; foreach (var child in childElements) { child.parent = this; } #if WITH_TREEVIEWITEM children = srcChildren; foreach (var child in srcChildren) { child.parent = this; } #endif }
Element Deserialize(int index, out int count) { SerializableElementNode node = root[index]; #if WITH_TREEVIEWITEM var children = new List <TreeViewItem>(); #endif var childElements = new List <Element>(); Element element; int childCount; int offset = 0; for (int i0 = 0; i0 < node.childCount; ++i0) { element = Deserialize(node.indexOfFirstChild + offset + i0, out childCount); #if WITH_TREEVIEWITEM children.Add(element); #endif childElements.Add(element); offset += childCount; } count = node.childCount + offset; #if WITH_TREEVIEWITEM return(new Element(node, childElements, children)); #else return(new Element(node, childElements)); #endif }
public Element(SerializableElementNode node, List <Element> srcChildElements, List <TreeViewItem> srcChildren)