CSharpTest.Net
Item Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Html Namespace > XmlLightAttributes Class : Item Property

name

Glossary Item Box

Gets or Sets the attribute's unencoded text value

Syntax

Visual Basic (Declaration) 
Public Default Property Item( _
   ByVal name As String _
) As String
C# 
public string this[ 
   string name
]; {get; set;}

Parameters

name

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
XmlLightElement root = new XmlLightElement(null, "root");
new XmlLightElement(root, "a").Attributes["b"] = "c";
new XmlLightElement(root, XmlLightElement.TEXT).Value = "Normal & <Encoded> Text";
new XmlLightElement(root, XmlLightElement.COMMENT).OriginalTag = "<!-- This is just a <simple> comment. -->";
new XmlLightElement(root, XmlLightElement.CONTROL){
    OriginalTag = "<? Hey, that isn't valid !>"
}.Remove();

StringWriter sw = new StringWriter();
root.WriteUnformatted(sw);
Assert.AreEqual("<root><a b=\"c\"/>Normal &amp; &lt;Encoded&gt; Text<!-- This is just a <simple> comment. --></root>", sw.ToString());
VB.NETCopy Code
Dim root As New XmlLightElement(Nothing, "root")
New XmlLightElement(root, "a").Attributes("b") = "c"
New XmlLightElement(root, XmlLightElement.TEXT).Value = "Normal & <Encoded> Text"
New XmlLightElement(root, XmlLightElement.COMMENT).OriginalTag = "<!-- This is just a <simple> comment. -->"
New XmlLightElement(root, XmlLightElement.CONTROL) With { _
    Key .OriginalTag = "<? Hey, that isn't valid !>" _
}.Remove()

Dim sw As New StringWriter()
root.WriteUnformatted(sw)
Assert.AreEqual("<root><a b=""c""/>Normal &amp; &lt;Encoded&gt; Text<!-- This is just a <simple> comment. --></root>", sw.ToString())

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys