1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
|
<Type Name="NameTable" FullName="System.Xml.NameTable" FullNameSP="System_Xml_NameTable" Maintainer="ecma">
<TypeSignature Language="ILASM" Value=".class public NameTable extends System.Xml.XmlNameTable" />
<TypeSignature Language="C#" Value="public class NameTable : System.Xml.XmlNameTable" />
<MemberOfLibrary>XML</MemberOfLibrary>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<ThreadingSafetyStatement>This class is multi-read threadsafe but not threadsafe for read/write.</ThreadingSafetyStatement>
<Docs>
<summary>
<para>Creates a table that stores unique instances of <see cref="T:System.String" qualify="true" /> objects.</para>
</summary>
<remarks>
<para>Only a single instance of any given string is stored even if the string is
added multiple times to the table.</para>
<para>Using this class provides an efficient means for an XML parser to use the
same <see cref="T:System.String" qualify="true" />
object for all repeated element and attribute names in an XML document. If the
same object is used for all repeated names, the efficiency of name
comparisons is increased by allowing the names to be compared using
object comparisons rather than string comparisons.</para>
<block subset="none" type="note">
<para>This class implements a single-threaded <see cref="T:System.Xml.XmlNameTable" /> .</para>
<para>This class is used internally by the <see cref="T:System.Xml.XmlNamespaceManager" />,
<see cref="T:System.Xml.XmlParserContext" />, and <see cref="T:System.Xml.XmlTextReader" /> classes to store element and attribute names.</para>
</block>
</remarks>
<example>
<para> The following example demonstrates the difference between
equal string values and equal <see cref="T:System.String" qualify="true" /> objects using
the <see cref="T:System.Xml.NameTable" />
class.
</para>
<code lang="C#">using System;
using System.Text;
using System.Xml;
class Ntable {
public static void Main() {
NameTable nameTable = new NameTable();
string str1 = "sunny";
StringBuilder strBuilder = new StringBuilder();
string str2 =
strBuilder.Append("sun").Append("ny").ToString();
Console.WriteLine( "{0} : {1}",
str1, str2 );
Console.WriteLine( "{0} : {1}",
str1 == str2,
(Object)str1==(Object)str2 );
string str3 = nameTable.Add(str1);
string str4 = nameTable.Add(str2);
Console.WriteLine( "{0} : {1}",
str3, str4 );
Console.WriteLine( "{0} : {1}",
str3 == str4,
(Object)str3==(Object)str4 );
}
}
</code>
<para>The output is</para>
<para>sunny : sunny</para>
<para>True : False</para>
<para>sunny : sunny</para>
<para>True : True</para>
</example>
</Docs>
<Base>
<BaseTypeName>System.Xml.XmlNameTable</BaseTypeName>
</Base>
<Interfaces />
<Members>
<Member MemberName="Add">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual string Add(string key)" />
<MemberSignature Language="C#" Value="public override string Add (string key);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="key" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para> Adds the specified <see cref="T:System.String" qualify="true" /> to the table if a <see cref="T:System.String" qualify="true" />
instance with the same value does not already exist in the table.</para>
</summary>
<param name="key">The <see cref="T:System.String" /> to add.</param>
<returns>
<para>
<paramref name="key" />, if it did not exist in the
table at the time of the call, or the <see cref="T:System.String" /> instance previously stored in the table with a value equal to
<paramref name="key" />.</para>
</returns>
<exception cref="T:System.ArgumentNullException">
<paramref name="key" /> is <see langword="null" />.</exception>
<remarks>
<para>Only a single instance of any given <see cref="T:System.String" /> is stored in the table. If the value of <paramref name="key" /> is
already stored in the table, the <see cref="T:System.String" /> instance with that value is
returned.</para>
<block subset="none" type="note">
<para>This method overrides <see cref="M:System.Xml.XmlNameTable.Add(System.Char[],System.Int32,System.Int32)" qualify="true" />(<see langword="String" />).</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Add">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual string Add(class System.Char[] key, int32 start, int32 len)" />
<MemberSignature Language="C#" Value="public override string Add (char[] key, int start, int len);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="key" Type="System.Char[]" />
<Parameter Name="start" Type="System.Int32" />
<Parameter Name="len" Type="System.Int32" />
</Parameters>
<Docs>
<summary>
<para>Adds the <see cref="T:System.String" qualify="true" /> equivalent of a specified subset of a
<see cref="T:System.Char" qualify="true" /> array to the table if the string equivalent does not already exist in the
table.</para>
</summary>
<param name="key">A <see cref="T:System.Char" qualify="true" /> array containing the string to add.</param>
<param name="start">A <see cref="T:System.Int32" qualify="true" /> specifying the zero-based index into the array of the first character of the string.</param>
<param name="len">A <see cref="T:System.Int32" qualify="true" /> containing the number of characters in the string.</param>
<returns>
<para>The <see cref="T:System.String" qualify="true" /> equivalent of the
specified subset of the <see cref="T:System.Char" qualify="true" /> array that is stored in the
table, or <see cref="F:System.String.Empty" qualify="true" />
if <paramref name="len" /> is
zero.</para>
</returns>
<exception cref="T:System.IndexOutOfRangeException">
<para>
<paramref name="start" /> < 0.</para>
<para>- or -</para>
<para>
<paramref name="start" /> >= <paramref name="key" />.Length.</para>
<para>- or -</para>
<para>
<paramref name="len" /> > <paramref name="key" />.Length - <paramref name="start" />.</para>
<para>The above conditions do not cause an exception to be thrown if <paramref name="len" /> = 0.</para>
</exception>
<exception cref="T:System.ArgumentOutOfRangeException">len < 0.</exception>
<remarks>
<para>Only a single instance of any given <see cref="T:System.String" /> is stored in the table. Calling this method with the
same subset (containing the same characters) of any <see cref="T:System.Char" qualify="true" /> array, returns
the same instance of the <see cref="T:System.String" qualify="true" /> equivalent.</para>
<block subset="none" type="note">
<para>This method overrides <see cref="M:System.Xml.XmlNameTable.Add(System.Char[],System.Int32,System.Int32)" qualify="true" />(<see langword="Char" />[], <see langword="Int32" />, <see langword="Int32" />).</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Get">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual string Get(string value)" />
<MemberSignature Language="C#" Value="public override string Get (string value);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para>Looks up the value of the specified <see cref="T:System.String" qualify="true" /> in the table.</para>
</summary>
<param name="value">The <see cref="T:System.String" qualify="true" /> to look up.</param>
<returns>
<para>The <see cref="T:System.String" /> instance previously stored in the table with a value
equal to <paramref name="value" /> , or
<see langword="null" /> if
it does not exist.</para>
</returns>
<exception cref="T:System.ArgumentNullException">
<paramref name="value" /> is <see langword="null" />.</exception>
<remarks>
<para>Only a single instance of any given <see cref="T:System.String" /> is stored in the table. If the value of
<paramref name="value" /> is already stored in the table, the <see cref="T:System.String" /> instance with that value is returned.</para>
<block subset="none" type="note">
<para>This method overrides <see cref="M:System.Xml.XmlNameTable.Get(System.Char[],System.Int32,System.Int32)" qualify="true" />(<see langword="String" />).</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Get">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual string Get(class System.Char[] key, int32 start, int32 len)" />
<MemberSignature Language="C#" Value="public override string Get (char[] key, int start, int len);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="key" Type="System.Char[]" />
<Parameter Name="start" Type="System.Int32" />
<Parameter Name="len" Type="System.Int32" />
</Parameters>
<Docs>
<summary>
<para>Looks up the <see cref="T:System.String" qualify="true" /> equivalent to a specified subset of a
<see cref="T:System.Char" qualify="true" /> array in the table.</para>
</summary>
<param name="key">A <see cref="T:System.Char" qualify="true" /> array containing the string to look up.</param>
<param name="start">A <see cref="T:System.Int32" qualify="true" /> specifying the zero-based index into the array of the first character of the string.</param>
<param name="len">A <see cref="T:System.Int32" qualify="true" /> containing the number of characters in the string.</param>
<returns>
<para>The <see cref="T:System.String" qualify="true" /> equivalent of the specified subset of the <see cref="T:System.Char" qualify="true" /> array that is
stored in the table, or <see langword="null" /> if the
equivalent <see cref="T:System.String" /> is not
in the table.</para>
</returns>
<exception cref="T:System.IndexOutOfRangeException">
<paramref name="start" /> < 0. <para>- or -</para><para>
<paramref name="start" /> >= <paramref name="key" />.Length.</para><para>- or -</para><para>
<paramref name="len" /> > <paramref name="key" />.Length - <paramref name="start" />.</para><para>The above conditions do not cause an exception to be thrown if <paramref name="len" /> = 0.</para></exception>
<exception cref="T:System.ArgumentOutOfRangeException">len < 0.</exception>
<remarks>
<para>Only a single instance of any given <see cref="T:System.String" /> is stored in the table. Calling this method with the same subset (containing the same characters) of
any <see cref="T:System.Char" qualify="true" />
array, returns the same instance of the <see cref="T:System.String" qualify="true" /> equivalent, if it
exists.</para>
<block subset="none" type="note">
<para>This method overrides <see cref="M:System.Xml.XmlNameTable.Get(System.Char[],System.Int32,System.Int32)" qualify="true" />(<see langword="Char" />[], <see langword="Int32" />, <see langword="Int32" />).</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor()" />
<MemberSignature Language="C#" Value="public NameTable ();" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs>
<summary>
<para>Constructs and initializes a new instance of
the <see cref="T:System.Xml.NameTable" /> class.</para>
</summary>
<remarks>To be added.</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
</Members>
<TypeExcluded>0</TypeExcluded>
</Type>
|