System.Xml.XmlTextWriter.StartDocument C# (CSharp) Method

StartDocument() private method

private StartDocument ( int standalone ) : void
standalone int
return void
        void StartDocument(int standalone) {
            try {
                if (this.currentState != State.Start) {
                    throw new InvalidOperationException(Res.GetString(Res.Xml_NotTheFirst));
                }
                this.stateTable = stateTableDocument;
                this.currentState = State.Prolog;

                StringBuilder bufBld = new StringBuilder(128);
                bufBld.Append("version=" + quoteChar + "1.0" + quoteChar);
                if (this.encoding != null) {
                    bufBld.Append(" encoding=");
                    bufBld.Append(quoteChar);
                    bufBld.Append(this.encoding.WebName);
                    bufBld.Append(quoteChar);
                }
                if (standalone >= 0) {
                    bufBld.Append(" standalone=");
                    bufBld.Append(quoteChar);
                    bufBld.Append(standalone == 0 ? "no" : "yes");
                    bufBld.Append(quoteChar);
                }
                InternalWriteProcessingInstruction("xml", bufBld.ToString());
            }
            catch {
                currentState = State.Error;
                throw;
            }
        }