Class LanguageNode

LanguageNode are items in a LanguageDocument that is used to store the content of language translation files.

Inheritance
System.Object
LanguageNode
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[Obsolete("Use EPiServer.Framework.Localization.LocalizationService instead", false)]
public class LanguageNode

Constructors

LanguageNode(String)

Create a new LanguageNode with the given name.

Declaration
public LanguageNode(string name)
Parameters
Type Name Description
System.String name

The name of the new node.

Properties

Attribute

Get the attribute of the node (if any).

Declaration
public string Attribute { get; }
Property Value
Type Description
System.String
Remarks

Returns the attribute, if no attribute defined for this node it returns String.Empty. See description of the Name property for more details.

Children

Get a collection of children to this node.

Declaration
public ICollection<LanguageNode> Children { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<LanguageNode>
Remarks

Even if no children exists, a valid collection is returned with Count = 0

Item[String]

Accesses the child node with the requested name.

Declaration
public LanguageNode this[string name] { get; set; }
Parameters
Type Name Description
System.String name

Name of the child node to access.

Property Value
Type Description
LanguageNode

The requested LanguageNode.

Remarks

If the node is not found, null is returned for the get accessor and a new node is inserted for the set accessor.

Name

Get the name of the node.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
Remarks

If the node has an attribute, it will be returned with the Name property. To get the name without attribute, use the SimpleName property. I e if the node is created with constructor parameter &quot;node[@id=23]&quot;, Name will return &quot;node[@id=23]&quot;, SimpleName will return "node" and Attribute will return " [@id=23]&quot;.

Parent

Get the parent of this node.

Declaration
public LanguageNode Parent { get; }
Property Value
Type Description
LanguageNode
Remarks

If this is the root node, null is returned.

Path

Get the full path to this node.

Declaration
public string Path { get; }
Property Value
Type Description
System.String
Remarks

Returns a path formatted as a simple XPath expression, for example "/root/child1/child2".

SimpleName

Get the name of the node without attribute.

Declaration
public string SimpleName { get; }
Property Value
Type Description
System.String
Remarks

See descriptino of the Name property for more details.

Value

Access the value of the node.

Declaration
public string Value { get; set; }
Property Value
Type Description
System.String
Remarks

If the node has not been give a value, it will return String.Empty.

Methods

AddIfNotExist(String)

Add a new node with the given name if it does not exists, otherwise returns the existing node.

Declaration
public LanguageNode AddIfNotExist(string name)
Parameters
Type Name Description
System.String name

The node name.

Returns
Type Description
LanguageNode

A new or previously existing node.

ToString()

Returns a System.String with xml for the current node and all sub nodes.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents the inner content for this node and all sub nodes.

Overrides
System.Object.ToString()

Extension Methods