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
- XmlSchemaCollection.cs
- BaseTemplateParser.cs
- UriParserTemplates.cs
- SystemNetworkInterface.cs
- basemetadatamappingvisitor.cs
- _ListenerResponseStream.cs
- Identity.cs
- SQLBinaryStorage.cs
- DesignTimeVisibleAttribute.cs
- Point4D.cs
- LeaseManager.cs
- BufferModesCollection.cs
- ClientScriptManagerWrapper.cs
- VisualStyleTypesAndProperties.cs
- ProviderConnectionPoint.cs
- Win32.cs
- ResourceReferenceKeyNotFoundException.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ObjectStateEntryDbDataRecord.cs
- GeneratedCodeAttribute.cs
- Int32RectConverter.cs
- Dispatcher.cs
- FileDialog_Vista.cs
- DbProviderFactories.cs
- DynamicPropertyHolder.cs
- OdbcConnectionHandle.cs
- AccessDataSourceDesigner.cs
- Int16AnimationUsingKeyFrames.cs
- FunctionParameter.cs
- TextViewSelectionProcessor.cs
- TriState.cs
- ConnectionDemuxer.cs
- DataGridViewDesigner.cs
- CaretElement.cs
- Variable.cs
- DataControlReferenceCollection.cs
- UIInitializationException.cs
- ButtonChrome.cs
- DisplayNameAttribute.cs
- SiteOfOriginPart.cs
- Classification.cs
- Point3DKeyFrameCollection.cs
- LogLogRecordHeader.cs
- RowSpanVector.cs
- DataGridViewColumnStateChangedEventArgs.cs
- AnimatedTypeHelpers.cs
- Constraint.cs
- Misc.cs
- CatalogPartChrome.cs
- TemplateControlBuildProvider.cs
- QueryAccessibilityHelpEvent.cs
- Deserializer.cs
- ADMembershipUser.cs
- JoinGraph.cs
- InvalidWMPVersionException.cs
- WinInetCache.cs
- SplineKeyFrames.cs
- GridViewCommandEventArgs.cs
- InternalEnumValidatorAttribute.cs
- ClientProxyGenerator.cs
- OleTxTransaction.cs
- Funcletizer.cs
- CustomErrorCollection.cs
- SamlAuthorizationDecisionClaimResource.cs
- RTTrackingProfile.cs
- SiteMapPath.cs
- DateTimeConverter.cs
- DataGridViewCellCollection.cs
- SafeEventHandle.cs
- ElementHostAutomationPeer.cs
- SuppressMergeCheckAttribute.cs
- ConnectionPoint.cs
- ControlIdConverter.cs
- CellLabel.cs
- OverflowException.cs
- XPathAncestorQuery.cs
- ApplicationSettingsBase.cs
- Rectangle.cs
- _ScatterGatherBuffers.cs
- IntranetCredentialPolicy.cs
- CompareInfo.cs
- XamlHttpHandlerFactory.cs
- GlobalAclOperationRequirement.cs
- XPathNode.cs
- IList.cs
- GridItemCollection.cs
- Aggregates.cs
- DataSourceControl.cs
- ExpressionQuoter.cs
- RemoteArgument.cs
- SqlCommandSet.cs
- FrameworkContentElement.cs
- TileBrush.cs
- CriticalFinalizerObject.cs
- PackageRelationship.cs
- PointLight.cs
- TransformDescriptor.cs
- XmlNodeComparer.cs
- UpDownEvent.cs
- SecurityTokenAuthenticator.cs