JSIL.Internal.SourceMapBuilder.MakeRelativePath C# (CSharp) Method

MakeRelativePath() public static method

public static MakeRelativePath ( string fromPath, string toPath ) : Uri
fromPath string
toPath string
return System.Uri
        public static Uri MakeRelativePath(string fromPath, string toPath)
        {
            if (string.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath");
            if (string.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath");

            Uri fromUri = new Uri(Path.GetFullPath(fromPath));
            Uri toUri = new Uri(Path.GetFullPath(toPath));

            if (fromUri.Scheme != toUri.Scheme) { return toUri; } // path can't be made relative.

            return fromUri.MakeRelativeUri(toUri);
        }