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
- UIPropertyMetadata.cs
- CultureData.cs
- WaitHandle.cs
- IisTraceWebEventProvider.cs
- DetailsView.cs
- TextHidden.cs
- DataGridViewColumnHeaderCell.cs
- Module.cs
- DataGridViewRowStateChangedEventArgs.cs
- httpstaticobjectscollection.cs
- WebPartDescription.cs
- WebPartRestoreVerb.cs
- EvidenceTypeDescriptor.cs
- DuplicateWaitObjectException.cs
- RemotingSurrogateSelector.cs
- EpmAttributeNameBuilder.cs
- WrapPanel.cs
- ProcessHost.cs
- NativeWrapper.cs
- ConnectionsZone.cs
- AutomationPatternInfo.cs
- EventMetadata.cs
- SecurityContext.cs
- serverconfig.cs
- AddInIpcChannel.cs
- DBPropSet.cs
- GridSplitterAutomationPeer.cs
- GatewayIPAddressInformationCollection.cs
- AuthenticationException.cs
- OutputCacheSettings.cs
- recordstatefactory.cs
- TemplateControl.cs
- GroupBox.cs
- ScrollBarRenderer.cs
- IntellisenseTextBox.designer.cs
- ConstructorNeedsTagAttribute.cs
- OpCodes.cs
- WebDescriptionAttribute.cs
- NavigationExpr.cs
- Filter.cs
- HostVisual.cs
- FacetValueContainer.cs
- SecurityChannelListener.cs
- XpsFont.cs
- LogExtentCollection.cs
- MembershipUser.cs
- DocumentViewerBaseAutomationPeer.cs
- PrintPreviewControl.cs
- DateRangeEvent.cs
- WebPartsPersonalizationAuthorization.cs
- messageonlyhwndwrapper.cs
- FocusWithinProperty.cs
- Mapping.cs
- SourceInterpreter.cs
- AutomationElementCollection.cs
- WinEventTracker.cs
- XPathNodeIterator.cs
- BaseCodeDomTreeGenerator.cs
- SoundPlayerAction.cs
- EntityDataSourceStatementEditorForm.cs
- _SSPIWrapper.cs
- ToolStripPanelCell.cs
- ConfigXmlDocument.cs
- DirectoryInfo.cs
- AssemblyInfo.cs
- XmlDocumentFragment.cs
- TransformedBitmap.cs
- ListControl.cs
- HeaderedItemsControl.cs
- TypeSource.cs
- XPathQueryGenerator.cs
- ThemeableAttribute.cs
- EmptyControlCollection.cs
- ListViewHitTestInfo.cs
- ToolStripLabel.cs
- XsltOutput.cs
- CancellationToken.cs
- RepeaterCommandEventArgs.cs
- DeviceContexts.cs
- Content.cs
- Resources.Designer.cs
- UnsafeMethods.cs
- MaterialCollection.cs
- EdmItemError.cs
- SwitchLevelAttribute.cs
- XmlName.cs
- AnimationClockResource.cs
- UnauthorizedWebPart.cs
- UnsignedPublishLicense.cs
- OracleNumber.cs
- EncryptedPackage.cs
- SimpleFieldTemplateFactory.cs
- TrackingStringDictionary.cs
- ServicePointManager.cs
- PersonalizationDictionary.cs
- CodeExporter.cs
- OleCmdHelper.cs
- WebCategoryAttribute.cs
- Sql8ExpressionRewriter.cs
- Schema.cs