System.Xml.HtmlEncodedRawTextWriter.WriteDocType C# (CSharp) Méthode

WriteDocType() public méthode

public WriteDocType ( string name, string pubid, string sysid, string subset ) : void
name string
pubid string
sysid string
subset string
Résultat void
        public override void WriteDocType( string name, string pubid, string sysid, string subset ) {
            Debug.Assert( name != null && name.Length > 0 );

            if ( trackTextContent && inTextContent != false ) { ChangeTextContentMark( false ); }

            RawText( "<!DOCTYPE ");

            // Bug 114337: Always output "html" or "HTML" in doc-type, even if "name" is something else
            if ( name == "HTML" )
                RawText( "HTML" );
            else
                RawText( "html" );

            if ( pubid != null ) {
                RawText( " PUBLIC \"" );
                RawText( pubid );
                if ( sysid != null ) {
                    RawText( "\" \"" );
                    RawText( sysid );
                }
                bufChars[bufPos++] = (char) '"';
            }
            else if ( sysid != null ) {
                RawText( " SYSTEM \"" );
                RawText( sysid );
                bufChars[bufPos++] = (char) '"';
            }
            else {
                bufChars[bufPos++] = (char) ' ';
            }

            if ( subset != null ) {
                bufChars[bufPos++] = (char) '[';
                RawText( subset );
                bufChars[bufPos++] = (char) ']';
            }

            bufChars[this.bufPos++] = (char) '>';
        }