public void GetParentFileProjectItem_ResxFileNameAndCSharpParentFileExistsInProject_ReturnsParentFileProjectItem() { CreateCSharpProject(@"d:\projects\MyProject\MyProject.csproj"); FileProjectItem expectedProjectItem = AddFileToProject("test.cs"); CreateDependentFile(); string fileName = @"d:\projects\MyProject\test.resx"; FileProjectItem projectItem = dependentFile.GetParentFileProjectItem(fileName); Assert.AreEqual(expectedProjectItem, projectItem); }
string GetDependentUpon(string path) { var dependentFile = new DependentFile(MSBuildProject); FileProjectItem projectItem = dependentFile.GetParentFileProjectItem(path); if (projectItem != null) { return(Path.GetFileName(projectItem.Include)); } return(null); }
string GetDependentUpon(string path) { var dependentFile = new DependentFile(project); ProjectFile projectItem = dependentFile.GetParentFileProjectItem(path); if (projectItem != null) { string relativePath = GetRelativePath(projectItem.FilePath); return(Path.GetFileName(relativePath)); } return(null); }
string GetDependentUpon(string path) { var dependentFile = new DependentFile(MSBuildProject); FileProjectItem projectItem = dependentFile.GetParentFileProjectItem(path); if (projectItem != null) { return Path.GetFileName(projectItem.Include); } return null; }