System.Xml.XmlDictionaryReader.IsNamespaceUri C# (CSharp) Method

IsNamespaceUri() public method

public IsNamespaceUri ( string namespaceUri ) : bool
namespaceUri string
return bool
        public virtual bool IsNamespaceUri(string namespaceUri)
        {
            if (namespaceUri == null)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(namespaceUri));
            return this.NamespaceURI == namespaceUri;
        }

Same methods

XmlDictionaryReader::IsNamespaceUri ( System namespaceUri ) : bool
XmlDictionaryReader::IsNamespaceUri ( XmlDictionaryString namespaceUri ) : bool

Usage Example

 internal static EndpointAddress ReadFrom(XmlDictionaryReader reader, XmlDictionaryString localName, XmlDictionaryString ns, out AddressingVersion version)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
     }
     reader.ReadFullStartElement(localName, ns);
     reader.MoveToContent();
     if (reader.IsNamespaceUri(AddressingVersion.WSAddressing10.DictionaryNamespace))
     {
         version = AddressingVersion.WSAddressing10;
     }
     else if (reader.IsNamespaceUri(AddressingVersion.WSAddressingAugust2004.DictionaryNamespace))
     {
         version = AddressingVersion.WSAddressingAugust2004;
     }
     else
     {
         if (reader.NodeType != XmlNodeType.Element)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("reader", System.ServiceModel.SR.GetString("CannotDetectAddressingVersion"));
         }
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("reader", System.ServiceModel.SR.GetString("AddressingVersionNotSupported", new object[] { reader.NamespaceURI }));
     }
     EndpointAddress address = ReadFromDriver(version, reader);
     reader.ReadEndElement();
     return address;
 }
All Usage Examples Of System.Xml.XmlDictionaryReader::IsNamespaceUri