Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / Serialization / NameTable.cs / 1 / NameTable.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Serialization { using System.Collections; internal class NameKey { string ns; string name; internal NameKey(string name, string ns) { this.name = name; this.ns = ns; } public override bool Equals(object other) { if (!(other is NameKey)) return false; NameKey key = (NameKey)other; return name == key.name && ns == key.ns; } public override int GetHashCode() { return (ns == null ? "".GetHashCode() : ns.GetHashCode()) ^ (name == null ? 0 : name.GetHashCode()); } } internal interface INameScope { object this[string name, string ns] {get; set;} } internal class NameTable : INameScope { Hashtable table = new Hashtable(); internal void Add(XmlQualifiedName qname, object value) { Add(qname.Name, qname.Namespace, value); } internal void Add(string name, string ns, object value) { NameKey key = new NameKey(name, ns); table.Add(key, value); } internal object this[XmlQualifiedName qname] { get { return table[new NameKey(qname.Name, qname.Namespace)]; } set { table[new NameKey(qname.Name, qname.Namespace)] = value; } } internal object this[string name, string ns] { get { return table[new NameKey(name, ns)]; } set { table[new NameKey(name, ns)] = value; } } object INameScope.this[string name, string ns] { get { return table[new NameKey(name, ns)]; } set { table[new NameKey(name, ns)] = value; } } internal ICollection Values { get { return table.Values; } } internal Array ToArray(Type type) { Array a = Array.CreateInstance(type, table.Count); table.Values.CopyTo(a, 0); return a; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ScriptReferenceBase.cs
- SqlCacheDependencySection.cs
- CustomErrorCollection.cs
- TagMapCollection.cs
- TypeInitializationException.cs
- InkCanvasSelection.cs
- GlyphsSerializer.cs
- ResXDataNode.cs
- ToolStripSystemRenderer.cs
- SqlBulkCopy.cs
- ToolStripDesignerUtils.cs
- CompositeScriptReference.cs
- TextCharacters.cs
- XmlUtil.cs
- DataGridCommandEventArgs.cs
- IndentTextWriter.cs
- ModuleElement.cs
- CursorEditor.cs
- ExpressionConverter.cs
- XmlWellformedWriter.cs
- AtomicFile.cs
- SplineQuaternionKeyFrame.cs
- MatrixTransform.cs
- M3DUtil.cs
- ToolStripManager.cs
- Int64Converter.cs
- OLEDB_Util.cs
- ApplicationProxyInternal.cs
- InputLanguageManager.cs
- BufferBuilder.cs
- AssertFilter.cs
- TokenBasedSet.cs
- PlanCompiler.cs
- WebBrowserSiteBase.cs
- FixedDocumentPaginator.cs
- DeriveBytes.cs
- XamlStream.cs
- PrimitiveXmlSerializers.cs
- SemanticKeyElement.cs
- PackageDigitalSignature.cs
- KeyValueConfigurationCollection.cs
- SizeF.cs
- MissingManifestResourceException.cs
- SiteMap.cs
- CapabilitiesPattern.cs
- TextTreeUndoUnit.cs
- RMPublishingDialog.cs
- ConstantSlot.cs
- CacheChildrenQuery.cs
- WaitForChangedResult.cs
- coordinatorfactory.cs
- PageVisual.cs
- DataReaderContainer.cs
- ValidationErrorCollection.cs
- DynamicQueryStringParameter.cs
- HttpHandlerAction.cs
- sitestring.cs
- BitmapImage.cs
- ValueQuery.cs
- Slider.cs
- MemberPathMap.cs
- TextWriter.cs
- TextTreeDeleteContentUndoUnit.cs
- ThrowHelper.cs
- NativeMethods.cs
- String.cs
- TokenFactoryFactory.cs
- DropShadowBitmapEffect.cs
- bindurihelper.cs
- MSAANativeProvider.cs
- NamespaceExpr.cs
- XmlQuerySequence.cs
- ShaderEffect.cs
- SecurityElement.cs
- MessageOperationFormatter.cs
- AtomContentProperty.cs
- BindingMAnagerBase.cs
- SubstitutionList.cs
- XmlHierarchyData.cs
- CfgSemanticTag.cs
- ToolboxItemFilterAttribute.cs
- OleDbCommandBuilder.cs
- FlatButtonAppearance.cs
- CompatibleComparer.cs
- JsonWriterDelegator.cs
- ResourceDisplayNameAttribute.cs
- PropertyDescriptorComparer.cs
- DataGridViewComboBoxEditingControl.cs
- BoundPropertyEntry.cs
- wgx_sdk_version.cs
- WorkflowApplicationTerminatedException.cs
- UnicastIPAddressInformationCollection.cs
- SwitchElementsCollection.cs
- SHA384Cng.cs
- Hashtable.cs
- NextPreviousPagerField.cs
- AsymmetricAlgorithm.cs
- FixedBufferAttribute.cs
- OleDbPermission.cs
- WebBrowserNavigatingEventHandler.cs