internal bool ResolveParent ()
{
if (dependsOnFile == null && (!string.IsNullOrEmpty (dependsOn) && project != null)) {
//NOTE also that the dependent files are always assumed to be in the same directory
//This matches VS behaviour
string parentPath = Path.Combine (Path.GetDirectoryName (FilePath), Path.GetFileName (DependsOn));
//don't allow cyclic references
if (parentPath == FilePath) {
MonoDevelop.Core.LoggingService.LogWarning ("Cyclic dependency in project '{0}': file '{1}' depends on '{2}'", project == null ? "(none)" : project.Name, FilePath, parentPath);
return true;
}
dependsOnFile = project.Files.GetFile (parentPath);
if (dependsOnFile != null) {
if (dependsOnFile.dependentChildren == null)
dependsOnFile.dependentChildren = new List<ProjectFile> ();
dependsOnFile.dependentChildren.Add (this);
return true;
} else {
return false;
}
} else {
return true;
}
}
#endregion