private void addParentRegion(string path, ITreeNode model) { string name = getDirectoryName(path); ITreeNode regionParent = new ParentRegion(name); model.AddChild(regionParent); }
private bool formationPathExistsInModel(string path, ITreeNode model) { string formationName = getDirectoryName(path); string areaChildName = getDirectoryName(path, numberDirectoriesUp: 1); string areaParentName = getDirectoryName(path, numberDirectoriesUp: 2); ParentRegion parentArea = new ParentRegion(areaParentName); if (model.ContainsChild(parentArea)) { parentArea = (ParentRegion)model.GetChild(parentArea); if (parentArea.ContainsChildRegion(areaChildName)) { ChildRegion childRegion = parentArea.GetChildRegion(areaChildName); return(childRegion.ContainsFormation(formationName)); } } return(false); }