public class EasyXmlTextWriter : IDisposable
Public Class EasyXmlTextWriter
Implements IDisposable
Dim instance As EasyXmlTextWriter
public ref class EasyXmlTextWriter : IDisposable
type EasyXmlTextWriter =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
' Create a disposable instance od the EasyXmlTextWriter class.
Using xmlWriter As New EasyXmlTextWriter("C:\My Xml File.xml", Encoding.Default)
xmlWriter.XmlWriter.Formatting = Formatting.Indented
' Write the Xml header.
xmlWriter.WriteHeader()
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' Write a comment line.
xmlWriter.WriteCommentLine("Xml Songs Database", Formatting.Indented)
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' <!--Xml Songs Database-->
' Write the "Songs" root element.
xmlWriter.WriteBeginningElement("Songs", Formatting.Indented)
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' <!--Xml Songs Database-->
' <Songs>
' Write the start of a "song" element.
xmlWriter.WriteBeginningElement("Song", Formatting.Indented)
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' <!--Xml Songs Database-->
' <Songs>
' <Song>
' Write a "song" element.
xmlWriter.WriteElements({
{"Name", "My Song file.mp3"},
{"Year", "2013"},
{"Genre", "Rock"}
}, Formatting.None)
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' <!--Xml Songs Database-->
' <Songs>
' <Song><Name>My Song file.mp3</Name><Year>2007</Year><Genre>Dance</Genre>
' Write the end of a "song" element.
xmlWriter.WriteEndElement(Formatting.None)
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' <!--Xml Songs Database-->
' <Songs>
' <Song><Name>My Song file.mp3</Name><Year>2007</Year><Genre>Dance</Genre></Song>
' Write the end of the "Songs" root element.
xmlWriter.WriteEndElement(Formatting.Indented)
' Output at this point:
' Output at this point:
' <?xml version="1.0" encoding="Windows-1252"?>
' <!--Xml Songs Database-->
' <Songs>
' <Song><Name>My Song file.mp3</Name><Year>2007</Year><Genre>Dance</Genre></Song>
' </Songs>
' Write the Xml end of file.
xmlWriter.WriteEof(closeXmlWriter:=True)
' Final output:
'
'<?xml version="1.0" encoding="Windows-1252"?>
'<!--Xml Songs Database-->
'<Songs>
' <Song><Name>My Song file.mp3</Name><Year>2007</Year><Genre>Dance</Genre></Song>
'</Songs>
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
EasyXmlTextWriter | Initializes a new instance of the EasyXmlTextWriter class. |
XmlWriter | The underlying XmlTextWriter instance. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Inherited from Object) |
WriteBeginningElement | Writes the beginning of an Xml element. |
WriteCommentLine | Writes an Xml comment line. |
WriteElement | Writes an Xml element. |
WriteElements | Writes multiple Xml elements. |
WriteEndElement | Writes the end of an Xml element. |
WriteEof | Writes the ending Xml end of file. This method should be called to terminate writting the Xml. |
WriteHeader | Writes the starting Xml header. This method should be called to start writting the Xml. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |