Class StringDecoratorExtensions
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
decoratorIDecorator<string>The IDecorator<T> to extend.
Returns
- bool
trueif the enclosed string of the specifieddecoratoris 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
decoratorIDecorator<string>The IDecorator<T> to extend.
optionsLoadOptionsA LoadOptions that specifies white space behavior, and whether to load base URI and line information.
resultXElementWhen this method returns, it contains the XElement populated from the enclosed string of the specified
decoratorthat contains XML, if the conversion succeeded, or a null reference if the conversion failed.
Returns
- bool
trueif the enclosed string of the specifieddecoratorwas converted successfully; otherwise,false.
TryParseXElement(IDecorator<string>, out XElement)
public static bool TryParseXElement(this IDecorator<string> decorator, out XElement result)
Parameters
decoratorIDecorator<string>The IDecorator<T> to extend.
resultXElementWhen this method returns, it contains the XElement populated from the enclosed string of the specified
decoratorthat contains XML, if the conversion succeeded, or a null reference if the conversion failed.
Returns
- bool
trueif the enclosed string of the specifieddecoratorwas converted successfully; otherwise,false.