PackUriIsValid() public static method

public static PackUriIsValid ( Uri packUri ) : void
packUri System.Uri
return void
示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }