Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortherzok <marius.ungureanu@xamarin.com>2019-06-28 10:54:15 +0300
committertherzok <marius.ungureanu@xamarin.com>2019-07-06 22:17:32 +0300
commitcb0663c0819aa3f79b69de0806ca2f556ef3c437 (patch)
tree647a46ca4d1a3bf8c2ca17d59f9ab8df694e9cb4 /main/src/core/MonoDevelop.Core
parent7fbef70336e0c9166130cd2ffb1426c75bf24ac6 (diff)
Split ProjectVirtualPath into utility method
Diffstat (limited to 'main/src/core/MonoDevelop.Core')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs21
1 files changed, 13 insertions, 8 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs
index 416c0a84af..a2a18d15c8 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs
@@ -236,15 +236,20 @@ namespace MonoDevelop.Projects
/// </summary>
public FilePath ProjectVirtualPath {
get {
- if (!Link.IsNullOrEmpty)
- return Link;
- if (Project != null) {
- var rel = Project.GetRelativeChildPath (FilePath);
- if (!rel.ToString ().StartsWith ("..", StringComparison.Ordinal))
- return rel;
- }
- return FilePath.FileName;
+ return GetProjectVirtualPath (Link, FilePath, Project);
+ }
+ }
+
+ static FilePath GetProjectVirtualPath (FilePath link, FilePath filePath, Project project)
+ {
+ if (!link.IsNullOrEmpty)
+ return link;
+ if (project != null) {
+ var rel = project.GetRelativeChildPath (filePath);
+ if (!rel.ToString ().StartsWith ("..", StringComparison.Ordinal))
+ return rel;
}
+ return filePath.FileName;
}