private void Validate(bool allowDuplicateEquivalentUriTemplates) { if (this.baseAddress == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("UTTBaseAddressNotSet"))); } this.numSegmentsInBaseAddress = this.baseAddress.Segments.Length; if (this.templates.Count == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("UTTEmptyKeyValuePairs"))); } this.rootNode = UriTemplateTrieNode.Make(this.templates, allowDuplicateEquivalentUriTemplates); }
void Validate(bool allowDuplicateEquivalentUriTemplates) { if (this.baseAddress == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString( SR.UTTBaseAddressNotSet))); } this.numSegmentsInBaseAddress = this.baseAddress.Segments.Length; if (this.templates.Count == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString( SR.UTTEmptyKeyValuePairs))); } // build the trie and // validate that forall Uri u, at most one UriTemplate is a best match for u rootNode = UriTemplateTrieNode.Make(this.templates, allowDuplicateEquivalentUriTemplates); }