Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Serialization / NameTable.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BooleanFunctions.cs
- IntMinMaxAggregationOperator.cs
- DnsPermission.cs
- UnsafeNativeMethods.cs
- ProgressBarBrushConverter.cs
- codemethodreferenceexpression.cs
- _IPv6Address.cs
- DataGridViewSortCompareEventArgs.cs
- ProviderCollection.cs
- AutoResizedEvent.cs
- InstallerTypeAttribute.cs
- DataSourceExpressionCollection.cs
- CommunicationObjectFaultedException.cs
- ProfileGroupSettingsCollection.cs
- TypeFieldSchema.cs
- ParseNumbers.cs
- DocumentGrid.cs
- TraceHandlerErrorFormatter.cs
- SelectorAutomationPeer.cs
- DefinitionBase.cs
- WeakReference.cs
- GridEntry.cs
- UserPreferenceChangedEventArgs.cs
- TagNameToTypeMapper.cs
- TableLayoutPanel.cs
- DynamicRendererThreadManager.cs
- DetailsViewAutoFormat.cs
- ScrollContentPresenter.cs
- XmlEncodedRawTextWriter.cs
- TextSelectionHelper.cs
- mactripleDES.cs
- ServiceModelConfiguration.cs
- PartitionedDataSource.cs
- FixedStringLookup.cs
- AutomationPatternInfo.cs
- CompilationUnit.cs
- SqlAggregateChecker.cs
- TextDocumentView.cs
- SystemTcpStatistics.cs
- PerformanceCounterManager.cs
- ConfigurationManagerHelper.cs
- VideoDrawing.cs
- CursorConverter.cs
- precedingquery.cs
- GPRECTF.cs
- ISAPIWorkerRequest.cs
- CodeCatchClause.cs
- FileCodeGroup.cs
- HandlerFactoryCache.cs
- PrimaryKeyTypeConverter.cs
- WorkflowTimerService.cs
- Journal.cs
- PathFigureCollectionConverter.cs
- MDIClient.cs
- Delegate.cs
- SoapExtensionImporter.cs
- TrustLevelCollection.cs
- PolyBezierSegment.cs
- DynamicRendererThreadManager.cs
- DbConnectionPoolOptions.cs
- EntityDataSourceReferenceGroup.cs
- RuntimeWrappedException.cs
- WebZone.cs
- NullToBooleanConverter.cs
- OracleCommand.cs
- GridViewColumnHeader.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- HttpProfileGroupBase.cs
- ChangesetResponse.cs
- RegisteredScript.cs
- GroupBox.cs
- UnknownBitmapDecoder.cs
- KeyedByTypeCollection.cs
- CollectionChangeEventArgs.cs
- KeyGesture.cs
- ScriptResourceHandler.cs
- XMLSchema.cs
- StickyNoteContentControl.cs
- ScrollItemPattern.cs
- ClientTargetSection.cs
- BackgroundWorker.cs
- Int32CAMarshaler.cs
- RecognizerInfo.cs
- ToolStripContainer.cs
- TrustManager.cs
- MsmqInputMessage.cs
- metrodevice.cs
- ColumnTypeConverter.cs
- WindowsAltTab.cs
- WebPartUtil.cs
- WmpBitmapDecoder.cs
- SortQuery.cs
- DbgUtil.cs
- FacetDescriptionElement.cs
- securitycriticaldataformultiplegetandset.cs
- ColorBuilder.cs
- TemplateBindingExtensionConverter.cs
- Converter.cs
- HttpCookiesSection.cs
- NestedContainer.cs