diff options
author | therzok <marius.ungureanu@xamarin.com> | 2019-06-28 10:54:15 +0300 |
---|---|---|
committer | therzok <marius.ungureanu@xamarin.com> | 2019-07-06 22:17:32 +0300 |
commit | cb0663c0819aa3f79b69de0806ca2f556ef3c437 (patch) | |
tree | 647a46ca4d1a3bf8c2ca17d59f9ab8df694e9cb4 /main/src/core/MonoDevelop.Core | |
parent | 7fbef70336e0c9166130cd2ffb1426c75bf24ac6 (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.cs | 21 |
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; } |