public AsVariable this[int index] { get { if(directChildren_ == null) { uint childCount; DEBUG_PROPERTY_INFO[] childPropertyInfo = GetDirectChildrenInfo(debugPropertyInfo_, index, out childCount); directChildren_ = new AsVariable[childCount]; directChildren_[index] = new AsVariable(childPropertyInfo[0]); } else if(directChildren_[index] == null) { uint childCount; DEBUG_PROPERTY_INFO[] childPropertyInfo = GetDirectChildrenInfo(debugPropertyInfo_, index, out childCount); directChildren_[index] = new AsVariable(childPropertyInfo[0]); } return directChildren_[index]; } }
private void LoadAllChildren() { List<AsVariable> allChildren = new List<AsVariable>(); List<AsVariable> directChildren = new List<AsVariable>(); uint childCount; DEBUG_PROPERTY_INFO[] directChildrenProperty = GetDirectChildrenInfo(debugPropertyInfo_, -1, out childCount); foreach (DEBUG_PROPERTY_INFO childProperty in directChildrenProperty) { if (childProperty.bstrName == childProperty.bstrType) { AsVariable parentVar = new AsVariable(childProperty); AsVariable[] parentChildren = parentVar.Children; allChildren.Add(parentVar); allChildren.AddRange(parentChildren); directChildren.Add(parentVar); } else { AsVariable childVar = new AsVariable(childProperty); allChildren.Add(childVar); directChildren.Add(childVar); } } allChildren_ = allChildren.ToArray(); directChildren_ = directChildren.ToArray(); }