Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Serialization / NameTable.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeDescriptionProviderAttribute.cs
- PointAnimationUsingKeyFrames.cs
- IProvider.cs
- MasterPageBuildProvider.cs
- XmlILTrace.cs
- RegexParser.cs
- OdbcReferenceCollection.cs
- SQLChars.cs
- CodeChecksumPragma.cs
- XPathScanner.cs
- QilValidationVisitor.cs
- XsltCompileContext.cs
- AssociationTypeEmitter.cs
- BinaryObjectReader.cs
- HuffCodec.cs
- ListViewInsertedEventArgs.cs
- PropertyValueUIItem.cs
- DiscreteKeyFrames.cs
- BinaryParser.cs
- BaseCollection.cs
- Ticks.cs
- _TimerThread.cs
- ExpressionPrefixAttribute.cs
- XamlTypeMapper.cs
- CompilationUtil.cs
- DefaultSerializationProviderAttribute.cs
- ObjectDataSourceFilteringEventArgs.cs
- ZoomPercentageConverter.cs
- FixedSOMLineCollection.cs
- RegexCompiler.cs
- ValidatedMobileControlConverter.cs
- BaseParser.cs
- Input.cs
- ContextMenu.cs
- PerSessionInstanceContextProvider.cs
- DataServiceQueryProvider.cs
- ScaleTransform3D.cs
- AssemblyAttributes.cs
- XmlSchemaGroup.cs
- XPathQilFactory.cs
- AttachedPropertyMethodSelector.cs
- AnimatedTypeHelpers.cs
- ItemCollection.cs
- MenuItem.cs
- complextypematerializer.cs
- ScrollPattern.cs
- X509CertificateValidator.cs
- Int32Rect.cs
- TransformGroup.cs
- VectorCollectionConverter.cs
- ConnectionModeReader.cs
- SourceElementsCollection.cs
- BaseDataListPage.cs
- ValidatorUtils.cs
- EncodingConverter.cs
- Model3DCollection.cs
- VisualTreeUtils.cs
- WebRequestModuleElement.cs
- XmlStreamStore.cs
- Int64Animation.cs
- ImageSourceConverter.cs
- PartManifestEntry.cs
- StrokeCollection2.cs
- CommonRemoteMemoryBlock.cs
- ServiceObjectContainer.cs
- DataGridColumnCollection.cs
- IndexerNameAttribute.cs
- RadioButtonBaseAdapter.cs
- ViewStateAttachedPropertyFeature.cs
- CommandBindingCollection.cs
- XmlSerializerVersionAttribute.cs
- BamlRecordHelper.cs
- CryptoKeySecurity.cs
- SerializerDescriptor.cs
- AssemblyBuilder.cs
- Internal.cs
- DataRecordInternal.cs
- ConvertEvent.cs
- WebConfigurationHost.cs
- StateManagedCollection.cs
- DelegatingHeader.cs
- ListCommandEventArgs.cs
- PeerResolverBindingElement.cs
- ReplyChannelAcceptor.cs
- ReflectionServiceProvider.cs
- NestedContainer.cs
- LoginNameDesigner.cs
- ListItemCollection.cs
- MouseBinding.cs
- SkewTransform.cs
- MarkupCompilePass2.cs
- RunWorkerCompletedEventArgs.cs
- TimelineClockCollection.cs
- SqlDataSource.cs
- BitmapSizeOptions.cs
- LineSegment.cs
- TextDecoration.cs
- PDBReader.cs
- XmlSchemaParticle.cs
- SystemIPGlobalProperties.cs