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
- SoapExtensionStream.cs
- BlockingCollection.cs
- UserControl.cs
- Compiler.cs
- TreeBuilder.cs
- SystemWebExtensionsSectionGroup.cs
- FixedLineResult.cs
- UnsafeNativeMethods.cs
- MediaEntryAttribute.cs
- PreviewKeyDownEventArgs.cs
- FacetEnabledSchemaElement.cs
- SqlFlattener.cs
- _ConnectOverlappedAsyncResult.cs
- FormViewInsertEventArgs.cs
- IIS7UserPrincipal.cs
- TabletCollection.cs
- CreateInstanceBinder.cs
- Delegate.cs
- WebServiceResponse.cs
- ProfilePropertySettingsCollection.cs
- SmiRequestExecutor.cs
- AttributeCollection.cs
- PassportAuthentication.cs
- PropertyCollection.cs
- SafeLocalMemHandle.cs
- UTF8Encoding.cs
- JournalEntry.cs
- PageContentCollection.cs
- DataGridViewRowCancelEventArgs.cs
- TextCollapsingProperties.cs
- CoreChannel.cs
- SequenceQuery.cs
- ResolvedKeyFrameEntry.cs
- arabicshape.cs
- BufferedReceiveElement.cs
- XDRSchema.cs
- ExecutionContext.cs
- NullableFloatSumAggregationOperator.cs
- ClientTargetCollection.cs
- HtmlTextArea.cs
- TableCellCollection.cs
- DiffuseMaterial.cs
- ArrayExtension.cs
- TypeBuilder.cs
- TaskFileService.cs
- SystemUnicastIPAddressInformation.cs
- DataSpaceManager.cs
- PropertyInformation.cs
- FuncTypeConverter.cs
- ThousandthOfEmRealPoints.cs
- DetailsViewDeleteEventArgs.cs
- SqlConnectionPoolGroupProviderInfo.cs
- UriSectionReader.cs
- CatalogPartCollection.cs
- FormsAuthenticationConfiguration.cs
- XpsFilter.cs
- ListItemConverter.cs
- ForEachAction.cs
- IndentedTextWriter.cs
- Stack.cs
- MetadataFile.cs
- SapiInterop.cs
- Stylus.cs
- ValidationResult.cs
- PathFigureCollectionConverter.cs
- CollectionViewSource.cs
- Duration.cs
- DataGridViewLinkColumn.cs
- BinaryMethodMessage.cs
- DeferredSelectedIndexReference.cs
- ZeroOpNode.cs
- HttpValueCollection.cs
- Underline.cs
- BindValidator.cs
- Encoder.cs
- TextViewElement.cs
- MessageFilter.cs
- Currency.cs
- WeakReference.cs
- OracleConnection.cs
- ToolStripMenuItemDesigner.cs
- adornercollection.cs
- OracleConnection.cs
- DataProtection.cs
- WebPageTraceListener.cs
- XhtmlMobileTextWriter.cs
- _CacheStreams.cs
- PartialCachingAttribute.cs
- SimpleModelProvider.cs
- IFlowDocumentViewer.cs
- ChameleonKey.cs
- PaperSource.cs
- XmlSchemaIdentityConstraint.cs
- XPathNavigator.cs
- PackagingUtilities.cs
- ControlBindingsCollection.cs
- TailPinnedEventArgs.cs
- ModelVisual3D.cs
- EncoderNLS.cs
- OptimalTextSource.cs