public static Uri GetPackageUri(Uri packUri) { Check.PackUri(packUri); Check.PackUriIsValid(packUri); string s = packUri.Host.Replace(',', '/'); return(new Uri(Uri.UnescapeDataString(s), UriKind.RelativeOrAbsolute)); }
public static Uri GetPartUri(Uri packUri) { Check.PackUri(packUri); Check.PackUriIsValid(packUri); if (string.IsNullOrEmpty(packUri.AbsolutePath) || packUri.AbsolutePath == "/") { return(null); } return(new Uri(packUri.AbsolutePath, UriKind.Relative)); }
public static int ComparePackUri(Uri firstPackUri, Uri secondPackUri) { if (firstPackUri == null) { return(secondPackUri == null ? 0 : -1); } if (secondPackUri == null) { return(1); } Check.PackUriIsValid(firstPackUri); Check.PackUriIsValid(secondPackUri); // FIXME: What exactly is compared. Lets assume originalstring return(firstPackUri.OriginalString.CompareTo(secondPackUri.OriginalString)); }