/// <summary> /// Write the xml declaration. This must be the first call. /// </summary> internal override void WriteXmlDeclaration(XmlStandalone standalone) { _wrapped.WriteXmlDeclaration(standalone); }
internal override void WriteXmlDeclaration(XmlStandalone standalone) { // Forces xml writer to be created EnsureWrappedWriter(XmlOutputMethod.Xml); _wrapped.WriteXmlDeclaration(standalone); }
public void EventsToWriter(XmlWriter writer) { if (this.singleText.Count != 0) { writer.WriteString(this.singleText.GetResult()); } else { XmlRawWriter writer2 = writer as XmlRawWriter; for (int i = 0; i < this.pages.Count; i++) { XmlEvent[] eventArray = this.pages[i]; for (int j = 0; j < eventArray.Length; j++) { byte[] buffer; switch (eventArray[j].EventType) { case XmlEventType.Unknown: return; case XmlEventType.DocType: { writer.WriteDocType(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3, (string)eventArray[j].Object); continue; } case XmlEventType.StartElem: { writer.WriteStartElement(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.StartAttr: { writer.WriteStartAttribute(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.EndAttr: { writer.WriteEndAttribute(); continue; } case XmlEventType.CData: { writer.WriteCData(eventArray[j].String1); continue; } case XmlEventType.Comment: { writer.WriteComment(eventArray[j].String1); continue; } case XmlEventType.PI: { writer.WriteProcessingInstruction(eventArray[j].String1, eventArray[j].String2); continue; } case XmlEventType.Whitespace: { writer.WriteWhitespace(eventArray[j].String1); continue; } case XmlEventType.String: { writer.WriteString(eventArray[j].String1); continue; } case XmlEventType.Raw: { writer.WriteRaw(eventArray[j].String1); continue; } case XmlEventType.EntRef: { writer.WriteEntityRef(eventArray[j].String1); continue; } case XmlEventType.CharEnt: { writer.WriteCharEntity((char)eventArray[j].Object); continue; } case XmlEventType.SurrCharEnt: { char[] chArray = (char[])eventArray[j].Object; writer.WriteSurrogateCharEntity(chArray[0], chArray[1]); continue; } case XmlEventType.Base64: { buffer = (byte[])eventArray[j].Object; writer.WriteBase64(buffer, 0, buffer.Length); continue; } case XmlEventType.BinHex: { buffer = (byte[])eventArray[j].Object; writer.WriteBinHex(buffer, 0, buffer.Length); continue; } case XmlEventType.XmlDecl1: { if (writer2 != null) { writer2.WriteXmlDeclaration((XmlStandalone)eventArray[j].Object); } continue; } case XmlEventType.XmlDecl2: { if (writer2 != null) { writer2.WriteXmlDeclaration(eventArray[j].String1); } continue; } case XmlEventType.StartContent: { if (writer2 != null) { writer2.StartElementContent(); } continue; } case XmlEventType.EndElem: { if (writer2 == null) { break; } writer2.WriteEndElement(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.FullEndElem: { if (writer2 == null) { goto Label_0367; } writer2.WriteFullEndElement(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.Nmsp: { if (writer2 == null) { goto Label_0394; } writer2.WriteNamespaceDeclaration(eventArray[j].String1, eventArray[j].String2); continue; } case XmlEventType.EndBase64: { if (writer2 != null) { writer2.WriteEndBase64(); } continue; } case XmlEventType.Close: { writer.Close(); continue; } case XmlEventType.Flush: { writer.Flush(); continue; } case XmlEventType.Dispose: { writer.Dispose(); continue; } default: { continue; } } writer.WriteEndElement(); continue; Label_0367: writer.WriteFullEndElement(); continue; Label_0394: writer.WriteAttributeString("xmlns", eventArray[j].String1, "http://www.w3.org/2000/xmlns/", eventArray[j].String2); } } } }