Code:
/ DotNET / DotNET / 8.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
- parserscommon.cs
- HttpStaticObjectsCollectionBase.cs
- ScrollBar.cs
- BmpBitmapDecoder.cs
- BrowserDefinition.cs
- Window.cs
- DataSetMappper.cs
- VisualBasicValue.cs
- BitmapEffectCollection.cs
- SiteMapPath.cs
- AdCreatedEventArgs.cs
- StaticFileHandler.cs
- DbSourceParameterCollection.cs
- AspCompat.cs
- OrderedDictionary.cs
- FlatButtonAppearance.cs
- ObjectResult.cs
- QueryStringConverter.cs
- BufferedGraphicsManager.cs
- PrinterSettings.cs
- HTMLTextWriter.cs
- ReferenceConverter.cs
- Item.cs
- BindingWorker.cs
- HierarchicalDataBoundControlAdapter.cs
- RectConverter.cs
- Slider.cs
- HitTestDrawingContextWalker.cs
- WorkflowElementDialogWindow.xaml.cs
- XmlSchemaSimpleTypeList.cs
- XPathAncestorQuery.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- SingletonConnectionReader.cs
- CustomExpressionEventArgs.cs
- TextParagraphView.cs
- TcpAppDomainProtocolHandler.cs
- CachedBitmap.cs
- X509Certificate2.cs
- KeyEvent.cs
- ExtensionSimplifierMarkupObject.cs
- IPAddress.cs
- HtmlToClrEventProxy.cs
- KeyValueSerializer.cs
- AutomationFocusChangedEventArgs.cs
- PreProcessor.cs
- Triangle.cs
- BufferAllocator.cs
- SchemaLookupTable.cs
- TransactionState.cs
- SystemResourceKey.cs
- SourceFilter.cs
- Attributes.cs
- BlockCollection.cs
- PolicyValidator.cs
- InstanceHandle.cs
- StatusBarPanelClickEvent.cs
- TextElementCollectionHelper.cs
- PrinterResolution.cs
- ISFClipboardData.cs
- _IPv6Address.cs
- FixedSOMGroup.cs
- WindowsFormsDesignerOptionService.cs
- Stroke.cs
- WebPartHeaderCloseVerb.cs
- RoleServiceManager.cs
- TimelineGroup.cs
- DataBinding.cs
- ParseHttpDate.cs
- DragCompletedEventArgs.cs
- ContainerActivationHelper.cs
- MissingMethodException.cs
- iisPickupDirectory.cs
- ObjectHelper.cs
- SqlTypesSchemaImporter.cs
- TextSpan.cs
- DataBinder.cs
- ControlSerializer.cs
- CalendarDay.cs
- XmlSerializerFormatAttribute.cs
- ProgressBarBrushConverter.cs
- EntityDataSourceDataSelection.cs
- BrowserCapabilitiesFactoryBase.cs
- SymDocumentType.cs
- ViewManager.cs
- TagNameToTypeMapper.cs
- ConstructorNeedsTagAttribute.cs
- HMACMD5.cs
- SmuggledIUnknown.cs
- SqlVisitor.cs
- ListContractAdapter.cs
- OutputScopeManager.cs
- ReadOnlyObservableCollection.cs
- Menu.cs
- Missing.cs
- ScrollBarAutomationPeer.cs
- DataObjectEventArgs.cs
- OneOfConst.cs
- Matrix3DStack.cs
- IUnknownConstantAttribute.cs
- XmlSecureResolver.cs