Beispiel #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);
        }
Beispiel #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));
     }
 }
Beispiel #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);
		}
Beispiel #4
0
 public static bool IsValid(string identifier)
 {
     return(XriIdentifier.IsValidXri(identifier) || UriIdentifier.IsValidUri(identifier));
 }
Beispiel #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));
 }