System.Xml.XmlConvert.VerifyQName C# (CSharp) Method

VerifyQName() static private method

static private VerifyQName ( string name, ExceptionType exceptionType ) : string
name string
exceptionType ExceptionType
return string
        internal static unsafe string VerifyQName(string name, ExceptionType exceptionType)
        {
            if (name == null || name.Length == 0)
            {
                throw new ArgumentNullException(nameof(name));
            }

            int colonPosition = -1;

            int endPos = ValidateNames.ParseQName(name, 0, out colonPosition);
            if (endPos != name.Length)
            {
                throw CreateException(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(name, endPos), exceptionType, 0, endPos + 1);
            }
            return name;
        }

Same methods

XmlConvert::VerifyQName ( string name ) : string

Usage Example

示例#1
0
 public override Task WriteNameAsync(string name)
 {
     if (_checkNames)
     {
         XmlConvert.VerifyQName(name, ExceptionType.XmlException);
     }
     return(writer.WriteNameAsync(name));
 }
All Usage Examples Of System.Xml.XmlConvert::VerifyQName