System.Xml.XmlTextEncoder.WriteSurrogateCharEntity C# (CSharp) Méthode

WriteSurrogateCharEntity() private méthode

private WriteSurrogateCharEntity ( char lowChar, char highChar ) : void
lowChar char
highChar char
Résultat void
        internal void WriteSurrogateCharEntity( char lowChar, char highChar ) {
            if ( ( (int)lowChar  < SurLowStart  || (int)lowChar  > SurLowEnd ) ||
                 ( (int)highChar < SurHighStart || (int)highChar > SurHighEnd ) ) {
                throw XmlConvert.CreateInvalidSurrogatePairException( lowChar, highChar );

            }
            int surrogateChar = ( (int)lowChar - SurLowStart ) | ( ( (int)highChar - SurHighStart ) << 10 ) + 0x10000;

            if ( cacheAttrValue ) {
                attrValue.Append( highChar );
                attrValue.Append( lowChar );
            }

            textWriter.Write( "&#x" );
            textWriter.Write( surrogateChar.ToString( "X", NumberFormatInfo.InvariantInfo ) );
            textWriter.Write( ';' );
        }