C# Class WebmasterToolsApi.Extensions.XDocumentExtensions

Exibir arquivo Open project: alexandernyquist/WebmasterToolsApi

Public Methods

Method Description
RemoveAllNamespaces ( System.Xml.Linq.XElement e ) : System.Xml.Linq.XElement

Removes all namespaces from a XDocument

Borrowed from http://stackoverflow.com/a/7238007/41596

ToExpandoObject ( this document ) : dynamic

Converts a XDocument into a ExpandoObject

ToValidPropertyName ( this instance ) : string

Formats a property name to a valid C# property name

Private Methods

Method Description
ParseNode ( System.Xml.Linq.XElement item ) : dynamic

Recursively walks through a XContainer adding properties to a ExpandoObject

Borrowed from http://famvdploeg.com/blog/2011/10/xml-to-expando/

Method Details

RemoveAllNamespaces() public static method

Removes all namespaces from a XDocument
Borrowed from http://stackoverflow.com/a/7238007/41596
public static RemoveAllNamespaces ( System.Xml.Linq.XElement e ) : System.Xml.Linq.XElement
e System.Xml.Linq.XElement
return System.Xml.Linq.XElement

ToExpandoObject() public static method

Converts a XDocument into a ExpandoObject
public static ToExpandoObject ( this document ) : dynamic
document this
return dynamic

ToValidPropertyName() public static method

Formats a property name to a valid C# property name
public static ToValidPropertyName ( this instance ) : string
instance this
return string