System.Xml.ValidateNames.ParseNCNameInternal C# (CSharp) Méthode

ParseNCNameInternal() private static méthode

Calls parseName and returns false or throws exception if the resulting name is not a valid NCName. Returns the input string if there is no error.
private static ParseNCNameInternal ( string s, bool throwOnError ) : bool
s string
throwOnError bool
Résultat bool
        private static bool ParseNCNameInternal(string s, bool throwOnError)
        {
            int len = ParseNCName(s, 0);

            if (len == 0 || len != s.Length)
            {
                // If the string is not a valid NCName, then throw or return false
                if (throwOnError) ThrowInvalidName(s, 0, len);
                return false;
            }

            return true;
        }