private ITreeNode createFormation(string path) { string name = getDirectoryName(path); ITreeNode formation; if (!name.Contains(SubFormation.DEMARCATOR)) { formation = new Formation(name); } else { formation = new SubFormation(name); } return(formation); }
private bool routePathExistsInModel(string path, ITreeNode model) { string routeName = getDirectoryName(path); string formationName = getDirectoryName(path, numberDirectoriesUp: 1); string areaChildName = getDirectoryName(path, numberDirectoriesUp: 2); string areaParentName = getDirectoryName(path, numberDirectoriesUp: 3); ParentRegion parentArea = new ParentRegion(areaParentName); if (model.ContainsChild(parentArea)) { parentArea = (ParentRegion)model.GetChild(parentArea); if (parentArea.ContainsChildRegion(areaChildName)) { ChildRegion childRegion = parentArea.GetChildRegion(areaChildName); if (childRegion.ContainsFormation(formationName)) { Formation formation = childRegion.GetFormation(formationName); return(formation.ContainsRoute(routeName)); } } } return(false); }
public Formation GetFormation(string name) { Formation formation = new Formation(name); return(GetChild(formation) as Formation); }
public bool ContainsFormation(string name) { Formation formation = new Formation(name); return(ContainsChild(formation)); }