Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- StringSource.cs
- ImageList.cs
- BuildProviderAppliesToAttribute.cs
- ComPlusInstanceContextInitializer.cs
- ScriptRegistrationManager.cs
- FontStyles.cs
- OdbcException.cs
- DataControlPagerLinkButton.cs
- GeometryHitTestResult.cs
- WebPartConnectVerb.cs
- Exceptions.cs
- DataGridViewElement.cs
- ISAPIWorkerRequest.cs
- DynamicRenderer.cs
- WebPartEditorCancelVerb.cs
- LicenseManager.cs
- BatchWriter.cs
- AuthenticationSection.cs
- CryptoConfig.cs
- Int64.cs
- SqlTrackingWorkflowInstance.cs
- ErrorHandler.cs
- XPathDocumentBuilder.cs
- X509Extension.cs
- InsufficientMemoryException.cs
- RowTypePropertyElement.cs
- XmlSignatureProperties.cs
- ExpressionReplacer.cs
- DataListCommandEventArgs.cs
- WebPartTransformer.cs
- DbProviderConfigurationHandler.cs
- LiteralTextContainerControlBuilder.cs
- GridViewColumnCollection.cs
- ValuePattern.cs
- OperandQuery.cs
- WebPartVerbCollection.cs
- UIElement3D.cs
- XPathMultyIterator.cs
- ExtendedProtectionPolicy.cs
- Oid.cs
- SafeCloseHandleCritical.cs
- Int64Animation.cs
- HtmlControl.cs
- PersonalizationProviderHelper.cs
- XmlSchemaSimpleContent.cs
- Dump.cs
- SafeRightsManagementQueryHandle.cs
- OracleColumn.cs
- COM2ICategorizePropertiesHandler.cs
- ConfigXmlWhitespace.cs
- ApplicationSecurityManager.cs
- DesignerView.cs
- StrokeNodeOperations2.cs
- ReadOnlyTernaryTree.cs
- DBCSCodePageEncoding.cs
- HybridCollection.cs
- PartitionResolver.cs
- XPathEmptyIterator.cs
- GroupByQueryOperator.cs
- SequentialActivityDesigner.cs
- TriggerCollection.cs
- OnOperation.cs
- WebPartUtil.cs
- DataServiceOperationContext.cs
- BulletChrome.cs
- HitTestFilterBehavior.cs
- CustomAttribute.cs
- CodeLabeledStatement.cs
- HttpPostedFile.cs
- OleServicesContext.cs
- ContainerSelectorBehavior.cs
- TagPrefixCollection.cs
- XPSSignatureDefinition.cs
- Assert.cs
- ScriptingJsonSerializationSection.cs
- SmiMetaDataProperty.cs
- ColorConvertedBitmap.cs
- IDReferencePropertyAttribute.cs
- TagMapInfo.cs
- _AcceptOverlappedAsyncResult.cs
- ClickablePoint.cs
- ContextStaticAttribute.cs
- RotateTransform.cs
- VoiceSynthesis.cs
- PersianCalendar.cs
- BackgroundFormatInfo.cs
- Single.cs
- SortFieldComparer.cs
- HttpHandlerAction.cs
- PrintEvent.cs
- MULTI_QI.cs
- ProfileSettingsCollection.cs
- XmlAutoDetectWriter.cs
- UnicodeEncoding.cs
- BaseValidatorDesigner.cs
- PropertyChangedEventArgs.cs
- ListItemConverter.cs
- OlePropertyStructs.cs
- RegisteredArrayDeclaration.cs
- HyperLinkColumn.cs