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

ParseNCNameThrow() static private méthode

Calls parseName and throws exception if the resulting name is not a valid NCName. Returns the input string if there is no error.
static private ParseNCNameThrow ( string s ) : string
s string
Résultat string
        internal static string ParseNCNameThrow(string s)
        {
            // throwOnError = true
            ParseNCNameInternal(s, true);
            return s;
        }

Usage Example

 private void ValidateQName( string prefix, string localName ) {
     try {
         if ( prefix.Length > 0 ) {
             ValidateNames.ParseNCNameThrow( prefix );
         }
         ValidateNames.ParseNCNameThrow( localName );
     }
     catch {
         state = State.Error;
         throw;
     }
 }