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
- DashStyles.cs
- CodeGenerator.cs
- MinMaxParagraphWidth.cs
- ReturnEventArgs.cs
- DataServiceQuery.cs
- Label.cs
- MulticastNotSupportedException.cs
- PrimitiveXmlSerializers.cs
- Constraint.cs
- AppDomainCompilerProxy.cs
- Thread.cs
- RelationshipConverter.cs
- SiteMapNode.cs
- ConnectionStringSettingsCollection.cs
- BindToObject.cs
- DesignerObject.cs
- ConfigurationValues.cs
- Clock.cs
- ChangeDirector.cs
- RawStylusSystemGestureInputReport.cs
- Vector3DCollectionConverter.cs
- TextParagraphCache.cs
- CaseExpr.cs
- CodeLabeledStatement.cs
- TableItemStyle.cs
- InvalidFilterCriteriaException.cs
- MetadataSource.cs
- SafeRegistryKey.cs
- TraceSection.cs
- NumericUpDownAcceleration.cs
- PageCatalogPart.cs
- querybuilder.cs
- UnsafeNativeMethods.cs
- RefreshPropertiesAttribute.cs
- CredentialCache.cs
- PartitionerStatic.cs
- SHA1Managed.cs
- Int32Converter.cs
- PropertyInformationCollection.cs
- CommandValueSerializer.cs
- DBConcurrencyException.cs
- ExpandCollapsePattern.cs
- UrlMappingsSection.cs
- PartialTrustValidationBehavior.cs
- PersonalizationDictionary.cs
- TextRangeEditTables.cs
- CapabilitiesAssignment.cs
- TraceLog.cs
- WebResourceAttribute.cs
- NavigationEventArgs.cs
- OutputBuffer.cs
- ValidatingReaderNodeData.cs
- SSmlParser.cs
- StylusButton.cs
- PropertyNames.cs
- ListControl.cs
- SecureEnvironment.cs
- UserPreferenceChangingEventArgs.cs
- ColorInterpolationModeValidation.cs
- Validator.cs
- LayoutTableCell.cs
- DataGridViewTextBoxCell.cs
- FileDetails.cs
- Int32RectConverter.cs
- BooleanFacetDescriptionElement.cs
- ToolStripLabel.cs
- DigestTraceRecordHelper.cs
- CallbackException.cs
- contentDescriptor.cs
- controlskin.cs
- D3DImage.cs
- ListContractAdapter.cs
- CollectionType.cs
- ExpressionPrefixAttribute.cs
- DataTable.cs
- InternalResources.cs
- DataObjectSettingDataEventArgs.cs
- Parser.cs
- WinInet.cs
- TagPrefixInfo.cs
- MessageHeaderDescriptionCollection.cs
- XmlHierarchyData.cs
- StatusCommandUI.cs
- NotifyIcon.cs
- RemoteCryptoDecryptRequest.cs
- XmlNodeChangedEventArgs.cs
- HostSecurityManager.cs
- EntityTransaction.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ConfigXmlElement.cs
- WebZone.cs
- PointCollection.cs
- ServiceOperationDetailViewControl.cs
- SystemColors.cs
- AccessDataSourceView.cs
- SqlNodeAnnotations.cs
- FormattedText.cs
- TextSelectionProcessor.cs
- ProfilePropertySettings.cs
- SqlTriggerAttribute.cs