New to Telerik UI for WPFStart a free 30-day trial

Provides helper methods for working with XML documents in the DrawingML context.

Definition

Namespace:Telerik.Windows.Documents.DrawingML

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public static class XmlDocumentHelper

Inheritance: objectXmlDocumentHelper

Methods

Reads a nullable attribute from an XML attribute and converts it to the specified type using the provided conversion function.

C#
public static T? ReadNullableAttribute<T>(XmlAttribute attribute, Func<string, T> converter) where T : struct
Parameters:attributeXmlAttribute

The XML attribute to read the value from.

converterFunc<string, T>

A function used to convert the attribute's string value to the specified type.

Returns:

T?

An object of type T representing the converted value if the attribute has a valid value; otherwise, null.

Reads a nullable boolean attribute from the provided XML attribute.

C#
public static bool? ReadNullableBoolAttribute(XmlAttribute attribute)
Parameters:attributeXmlAttribute

The XML attribute to read the nullable boolean value from.

Returns:

bool?

A nullable boolean representing the value of the attribute. Returns true if the attribute value is "true", false if the attribute value is "false", and null if the attribute is not present or has an invalid value.

Reads a nullable long attribute from the specified XML attribute.

C#
public static long? ReadNullableLongAttribute(XmlAttribute attribute)
Parameters:attributeXmlAttribute

The XML attribute from which to read the nullable long value.

Returns:

long?

Returns the long value represented by the XML attribute if it exists and is valid; otherwise, returns null.