internal void OnDeserialized(StreamingContext context) { UriSchemeKeyedCollection.ValidateBaseAddress(this.baseAddress, "context"); if (!HostNameComparisonModeHelper.IsDefined(this.HostNameComparisonMode)) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("context", System.ServiceModel.SR.GetString("Hosting_BaseUriDeserializedNotValid")); } this.SetComparisonAddressAndHashCode(); }
internal void OnDeserialized(StreamingContext context) { UriSchemeKeyedCollection.ValidateBaseAddress(_baseAddress, "context"); if (!HostNameComparisonModeHelper.IsDefined(HostNameComparisonMode)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("context", SR.Hosting_BaseUriDeserializedNotValid); } SetComparisonAddressAndHashCode(); }
public void RegisterUri(Uri uri, HostNameComparisonMode hostNameComparisonMode, TItem item) { Fx.Assert(HostNameComparisonModeHelper.IsDefined(hostNameComparisonMode), "RegisterUri: Invalid HostNameComparisonMode value passed in."); using (AsyncLock.TakeLock()) { // Since every newly registered Uri could alter what Prefixes should have matched, we // should clear the cache of any existing results and start over ClearCache(); BaseUriWithWildcard key = new BaseUriWithWildcard(uri, hostNameComparisonMode); SegmentHierarchyNode <TItem> node = FindOrCreateNode(key); if (node.Data != null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format( SR.DuplicateRegistration, uri))); } node.SetData(item, key); count++; } }