示例#1
0
        /// <summary>
        /// Tests equality between this XRI and another XRI.
        /// </summary>
        public override bool Equals(object obj)
        {
            XriIdentifier other = obj as XriIdentifier;

            if (other == null)
            {
                return(false);
            }
            return(this.CanonicalXri == other.CanonicalXri);
        }
示例#2
0
 public static Identifier Parse(string identifier)
 {
     if (string.IsNullOrEmpty(identifier))
     {
         throw new ArgumentNullException("identifier");
     }
     if (XriIdentifier.IsValidXri(identifier))
     {
         return(new XriIdentifier(identifier));
     }
     else
     {
         return(new UriIdentifier(identifier));
     }
 }
示例#3
0
		/// <summary>
		/// Performs discovery on THIS identifier, but generates <see cref="ServiceEndpoint"/>
		/// instances that treat another given identifier as the user-supplied identifier.
		/// </summary>
		internal IEnumerable<ServiceEndpoint> Discover(XriIdentifier userSuppliedIdentifier) {
			return downloadXrds().CreateServiceEndpoints(userSuppliedIdentifier);
		}
示例#4
0
 public static bool IsValid(string identifier)
 {
     return(XriIdentifier.IsValidXri(identifier) || UriIdentifier.IsValidUri(identifier));
 }
示例#5
0
 /// <summary>
 /// Performs discovery on THIS identifier, but generates <see cref="ServiceEndpoint"/>
 /// instances that treat another given identifier as the user-supplied identifier.
 /// </summary>
 internal IEnumerable <ServiceEndpoint> Discover(XriIdentifier userSuppliedIdentifier)
 {
     return(downloadXrds().CreateServiceEndpoints(userSuppliedIdentifier));
 }