Class StringDecoratorExtensions
- Namespace
- Cuemon.Xml.Linq
- Assembly
- Cuemon.Xml.dll
Extension methods for the String class hidden behind the IDecorator<T> interface.
public static class StringDecoratorExtensions
- Inheritance
-
StringDecoratorExtensions
Methods
IsXmlString(IDecorator<String>)
Determines whether the enclosed String of the specified decorator
is a valid XML string.
public static bool IsXmlString(this IDecorator<string> decorator)
Parameters
decorator
IDecorator<String>The IDecorator<T> to extend.
Returns
- Boolean
true
if the enclosed String of the specifieddecorator
is a valid XML string; otherwise,false
.
TryParseXElement(IDecorator<String>, LoadOptions, out XElement)
Tries to load an XElement from the enclosed String of the specified decorator
that contains XML, optionally preserving white space and retaining line information.
public static bool TryParseXElement(this IDecorator<string> decorator, LoadOptions options, out XElement result)
Parameters
decorator
IDecorator<String>The IDecorator<T> to extend.
options
LoadOptionsA LoadOptions that specifies white space behavior, and whether to load base URI and line information.
result
XElementWhen this method returns, it contains the XElement populated from the enclosed String of the specified
decorator
that contains XML, if the conversion succeeded, or a null reference if the conversion failed.
Returns
- Boolean
true
if the enclosed String of the specifieddecorator
was converted successfully; otherwise,false
.
TryParseXElement(IDecorator<String>, out XElement)
public static bool TryParseXElement(this IDecorator<string> decorator, out XElement result)
Parameters
decorator
IDecorator<String>The IDecorator<T> to extend.
result
XElementWhen this method returns, it contains the XElement populated from the enclosed String of the specified
decorator
that contains XML, if the conversion succeeded, or a null reference if the conversion failed.
Returns
- Boolean
true
if the enclosed String of the specifieddecorator
was converted successfully; otherwise,false
.