C# Class Concordion.Api.Element

A wrapper class for an XML element, usually from the specification or the target of the specification
Exibir arquivo Open project: concordion/concordion-net Class Usage Examples

Private Properties

Property Type Description
GetChildNodes IEnumerable
WrapXElements IEnumerable

Public Methods

Method Description
AddAttribute ( string localName, string value ) : Element

Adds an attribute to the element

AddStyleClass ( string style ) : Element

Applies a css class to the following element

AppendChild ( Element child ) : void

Appends a child Element after this one

AppendNonBreakingSpace ( ) : Element

Appends a nonbreaking space to the current Element

AppendNonBreakingSpaceIfBlank ( ) : Element

If the Element has no text then a element is appended

AppendSister ( Element element ) : void
AppendText ( string text ) : Element

Appends some text to the Element

Element ( System.Xml.Linq.XElement element ) : System

Constructs a new object of the ElemElementent type

Element ( string name ) : System

Constructs a new object of the Element type

Equals ( object obj ) : bool

Determines if another object equals this one

GetAttributeValue ( string attributeName ) : string

Gets the value of an attribute of the Element

GetAttributeValue ( string attributeName, string namespaceName ) : string

Gets the value of an attribute of the Element in the specified namespace

GetChildElements ( ) : IEnumerable

Gets only the immediate child Element of the current one

GetChildElements ( string name ) : IEnumerable
GetDescendantElements ( string name ) : IList

Gets all of he descendant Element objects with a specific name

GetFirstChildElement ( string elementName ) : Element

Gets the first child Element with the following name The document is searched in DOM document order

GetFirstDescendantNamed ( string name ) : Element

Gets the first descendant that matches the name

GetHashCode ( ) : int

Gets a hashcode of the object

GetRootElement ( ) : Element

Gets the root element of the System.Xml.Linq.XDocument that this Element is contained within

IsNamed ( string name ) : bool

Determines if the Element has a name like the parameter

MoveChildrenTo ( Element destinationElement ) : void

Moves all of the children of this Element to another element

PrependChild ( Element child ) : Element

Prepends a child Element before this one

PrependText ( string text ) : void

Adds some text to the first of the text of this Element>

SetId ( string id ) : Element

Sets the id of the current element

ToXml ( ) : string

Outputs the Element to a string as xml

Private Methods

Method Description
GetChildNodes ( ) : IEnumerable

Gets all child System.Xml.Linq.XNode

WrapXElements ( IEnumerable xElements ) : IEnumerable

Method Details

AddAttribute() public method

Adds an attribute to the element
public AddAttribute ( string localName, string value ) : Element
localName string The name of the attribute
value string The value of the attribute
return Element

AddStyleClass() public method

Applies a css class to the following element
public AddStyleClass ( string style ) : Element
style string The name of the style to apply
return Element

AppendChild() public method

Appends a child Element after this one
public AppendChild ( Element child ) : void
child Element
return void

AppendNonBreakingSpace() public method

Appends a nonbreaking space to the current Element
public AppendNonBreakingSpace ( ) : Element
return Element

AppendNonBreakingSpaceIfBlank() public method

If the Element has no text then a element is appended
public AppendNonBreakingSpaceIfBlank ( ) : Element
return Element

AppendSister() public method

public AppendSister ( Element element ) : void
element Element
return void

AppendText() public method

Appends some text to the Element
public AppendText ( string text ) : Element
text string
return Element

Element() public method

Constructs a new object of the ElemElementent type
public Element ( System.Xml.Linq.XElement element ) : System
element System.Xml.Linq.XElement The to wrap
return System

Element() public method

Constructs a new object of the Element type
public Element ( string name ) : System
name string The name of the new Element
return System

Equals() public method

Determines if another object equals this one
public Equals ( object obj ) : bool
obj object
return bool

GetAttributeValue() public method

Gets the value of an attribute of the Element
public GetAttributeValue ( string attributeName ) : string
attributeName string The name of the attribute
return string

GetAttributeValue() public method

Gets the value of an attribute of the Element in the specified namespace
public GetAttributeValue ( string attributeName, string namespaceName ) : string
attributeName string The name of the attribute
namespaceName string The name of the xml namespace
return string

GetChildElements() public method

Gets only the immediate child Element of the current one
public GetChildElements ( ) : IEnumerable
return IEnumerable

GetChildElements() public method

public GetChildElements ( string name ) : IEnumerable
name string
return IEnumerable

GetDescendantElements() public method

Gets all of he descendant Element objects with a specific name
public GetDescendantElements ( string name ) : IList
name string
return IList

GetFirstChildElement() public method

Gets the first child Element with the following name The document is searched in DOM document order
public GetFirstChildElement ( string elementName ) : Element
elementName string
return Element

GetFirstDescendantNamed() public method

Gets the first descendant that matches the name
public GetFirstDescendantNamed ( string name ) : Element
name string The name to find
return Element

GetHashCode() public method

Gets a hashcode of the object
public GetHashCode ( ) : int
return int

GetRootElement() public method

Gets the root element of the System.Xml.Linq.XDocument that this Element is contained within
public GetRootElement ( ) : Element
return Element

IsNamed() public method

Determines if the Element has a name like the parameter
public IsNamed ( string name ) : bool
name string
return bool

MoveChildrenTo() public method

Moves all of the children of this Element to another element
public MoveChildrenTo ( Element destinationElement ) : void
destinationElement Element
return void

PrependChild() public method

Prepends a child Element before this one
public PrependChild ( Element child ) : Element
child Element
return Element

PrependText() public method

Adds some text to the first of the text of this Element>
public PrependText ( string text ) : void
text string
return void

SetId() public method

Sets the id of the current element
public SetId ( string id ) : Element
id string The id to set
return Element

ToXml() public method

Outputs the Element to a string as xml
public ToXml ( ) : string
return string