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
- MetadataUtilsSmi.cs
- ArithmeticException.cs
- ResetableIterator.cs
- FileDataSourceCache.cs
- MediaScriptCommandRoutedEventArgs.cs
- EmptyCollection.cs
- DateRangeEvent.cs
- RectValueSerializer.cs
- SafeFileMapViewHandle.cs
- LambdaCompiler.cs
- IsolationInterop.cs
- PointAnimationUsingPath.cs
- XmlUtilWriter.cs
- OperationDescriptionCollection.cs
- RadioButtonStandardAdapter.cs
- HitTestResult.cs
- NumericUpDownAccelerationCollection.cs
- Timer.cs
- WindowsRegion.cs
- ReachPrintTicketSerializerAsync.cs
- TrustLevel.cs
- MembershipSection.cs
- CachingHintValidation.cs
- CodeEventReferenceExpression.cs
- EventLogConfiguration.cs
- EraserBehavior.cs
- WebPartConnection.cs
- ChildTable.cs
- XmlAttributeCache.cs
- PriorityQueue.cs
- SchemaObjectWriter.cs
- RemotingConfigParser.cs
- PerformanceCounter.cs
- CodeSnippetCompileUnit.cs
- AtlasWeb.Designer.cs
- Parser.cs
- DynamicRendererThreadManager.cs
- StylusCollection.cs
- XmlSchemas.cs
- ImageFormat.cs
- NativeRightsManagementAPIsStructures.cs
- MenuCommand.cs
- PhonemeEventArgs.cs
- ListViewCommandEventArgs.cs
- RemotingException.cs
- CompilerParameters.cs
- RegexWorker.cs
- itemelement.cs
- LayoutTableCell.cs
- DataGridLength.cs
- RequestCachingSection.cs
- HwndAppCommandInputProvider.cs
- WindowsTitleBar.cs
- sqlnorm.cs
- InputDevice.cs
- TypeUtil.cs
- AccessibilityHelperForVista.cs
- CompletionProxy.cs
- XmlSchemaAttribute.cs
- ChangeDirector.cs
- HttpStreamFormatter.cs
- AliasGenerator.cs
- AppSecurityManager.cs
- SubMenuStyle.cs
- FocusChangedEventArgs.cs
- BigInt.cs
- ImageDrawing.cs
- EventSource.cs
- SemanticResolver.cs
- StorageRoot.cs
- PinProtectionHelper.cs
- QueryRewriter.cs
- TreeViewCancelEvent.cs
- BulletDecorator.cs
- ApplicationTrust.cs
- MenuCommandService.cs
- MILUtilities.cs
- XmlSchemaAny.cs
- SoapInteropTypes.cs
- RtfControlWordInfo.cs
- MarkerProperties.cs
- DragEvent.cs
- RegexCompilationInfo.cs
- GridSplitter.cs
- TreeIterator.cs
- EventLogConfiguration.cs
- WindowsTreeView.cs
- IPEndPointCollection.cs
- TextRunTypographyProperties.cs
- TableCell.cs
- RelatedImageListAttribute.cs
- WhitespaceRule.cs
- CodeExporter.cs
- Version.cs
- ThreadInterruptedException.cs
- TextSegment.cs
- TextParagraphProperties.cs
- KoreanCalendar.cs
- PerformanceCounterPermissionAttribute.cs
- SerializationEventsCache.cs