XmlWriterSettings::Indent Property

 

Gets or sets a value indicating whether to indent elements.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public:
property bool Indent {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true to write individual elements on new lines and indent; otherwise, false. The default is false.

This property only applies to XmlWriter instances that output text content; otherwise, this setting is ignored.

The elements are indented as long as the element does not contain mixed content. Once the WriteString or WriteWhitespace method is called to write out a mixed element content, the XmlWriter stops indenting. The indenting resumes once the mixed content element is closed.

The following example creates an XmlWriter object that uses the TAB character for indentation.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: