Code:
/ DotNET / DotNET / 8.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
- Classification.cs
- PageTheme.cs
- ToolStripSeparator.cs
- AncestorChangedEventArgs.cs
- MembershipUser.cs
- TextFindEngine.cs
- PrintEvent.cs
- ScriptServiceAttribute.cs
- SafeViewOfFileHandle.cs
- PointLight.cs
- CodeCompiler.cs
- HttpListenerRequestTraceRecord.cs
- PropertyHelper.cs
- FactoryId.cs
- TreeNodeClickEventArgs.cs
- sortedlist.cs
- XPathParser.cs
- RoutedEvent.cs
- BrowserCapabilitiesFactoryBase.cs
- ManifestSignatureInformation.cs
- ScrollItemProviderWrapper.cs
- ObjectCacheSettings.cs
- RelationshipEnd.cs
- WinEventTracker.cs
- SecurityKeyIdentifierClause.cs
- DeclaredTypeElement.cs
- ManifestResourceInfo.cs
- ExtendedProperty.cs
- Gdiplus.cs
- DataGridViewCell.cs
- EntityTypeEmitter.cs
- Thread.cs
- ObjectQueryExecutionPlan.cs
- WebPart.cs
- basemetadatamappingvisitor.cs
- Propagator.JoinPropagator.cs
- ExpressionBuilder.cs
- ValidationSummaryDesigner.cs
- Object.cs
- MissingSatelliteAssemblyException.cs
- Brush.cs
- UserControl.cs
- TableParaClient.cs
- CustomAttributeFormatException.cs
- ModifierKeysConverter.cs
- DbParameterHelper.cs
- ReadOnlyTernaryTree.cs
- QilNode.cs
- ThousandthOfEmRealDoubles.cs
- MetafileEditor.cs
- CollectionDataContract.cs
- XDRSchema.cs
- DataControlFieldHeaderCell.cs
- SQLSingleStorage.cs
- DropShadowBitmapEffect.cs
- DataGridViewRowEventArgs.cs
- AccessControlList.cs
- TrackingConditionCollection.cs
- Bidi.cs
- XmlSchemaElement.cs
- PropertyDescriptorComparer.cs
- InteropTrackingRecord.cs
- DecoderFallback.cs
- SystemMulticastIPAddressInformation.cs
- _ChunkParse.cs
- InfoCardMetadataExchangeClient.cs
- MetadataSource.cs
- SqlClientWrapperSmiStreamChars.cs
- BooleanConverter.cs
- TableItemPattern.cs
- BufferedReceiveManager.cs
- SecurityTokenProviderContainer.cs
- DependentList.cs
- ButtonBaseAdapter.cs
- localization.cs
- KeyInstance.cs
- FixedSchema.cs
- SHA256Managed.cs
- XmlQueryStaticData.cs
- Code.cs
- QueryServiceConfigHandle.cs
- OverflowException.cs
- StructuredTypeEmitter.cs
- FormsAuthenticationConfiguration.cs
- DeviceContext2.cs
- Vector3DAnimationBase.cs
- FileSystemWatcher.cs
- HttpPostServerProtocol.cs
- ButtonStandardAdapter.cs
- FactoryId.cs
- FieldBuilder.cs
- Models.cs
- WebPartEditorCancelVerb.cs
- Pen.cs
- SafeEventLogWriteHandle.cs
- ButtonField.cs
- ResXDataNode.cs
- Compiler.cs
- SqlReorderer.cs
- ApplicationServiceHelper.cs