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
- SemanticValue.cs
- TextEffect.cs
- WebPartTransformerCollection.cs
- SqlInternalConnectionSmi.cs
- UInt32.cs
- RequestDescription.cs
- EditorZoneBase.cs
- UIElementParaClient.cs
- DefaultEvaluationContext.cs
- ByteBufferPool.cs
- IssuedTokenClientCredential.cs
- BinaryCommonClasses.cs
- EditorPart.cs
- MasterPageCodeDomTreeGenerator.cs
- Types.cs
- Convert.cs
- IISUnsafeMethods.cs
- DesignerHelpers.cs
- PageVisual.cs
- StaticTextPointer.cs
- basevalidator.cs
- X509UI.cs
- BitmapEffectGeneralTransform.cs
- AccessControlList.cs
- PersonalizationEntry.cs
- ConfigXmlDocument.cs
- SiteOfOriginContainer.cs
- Perspective.cs
- CachingHintValidation.cs
- FileChangesMonitor.cs
- FaultDesigner.cs
- BaseCollection.cs
- TabControl.cs
- XmlMemberMapping.cs
- DataColumnMapping.cs
- InputLanguageEventArgs.cs
- uribuilder.cs
- ColumnPropertiesGroup.cs
- GridViewCommandEventArgs.cs
- UnsafeNativeMethods.cs
- DBDataPermission.cs
- XmlDocumentViewSchema.cs
- NodeLabelEditEvent.cs
- NameValueConfigurationElement.cs
- IssuanceLicense.cs
- Random.cs
- ApplicationDirectory.cs
- XmlLinkedNode.cs
- DefaultValueTypeConverter.cs
- DataControlFieldsEditor.cs
- HtmlMobileTextWriter.cs
- HotSpotCollection.cs
- Image.cs
- ContentTextAutomationPeer.cs
- CodeAttributeDeclarationCollection.cs
- TrustManagerMoreInformation.cs
- WebMessageBodyStyleHelper.cs
- oledbconnectionstring.cs
- ChildrenQuery.cs
- localization.cs
- QuaternionRotation3D.cs
- RegexCode.cs
- XmlSchemaInferenceException.cs
- ComponentRenameEvent.cs
- PartialCachingControl.cs
- dsa.cs
- ReflectionTypeLoadException.cs
- UserControlBuildProvider.cs
- XsdCachingReader.cs
- BasicExpandProvider.cs
- LabelExpression.cs
- AnonymousIdentificationSection.cs
- AssertFilter.cs
- IntegerValidatorAttribute.cs
- DataGridTextBoxColumn.cs
- thaishape.cs
- KeysConverter.cs
- ConnectionStringsExpressionBuilder.cs
- MarshalByValueComponent.cs
- XmlSchemaObjectCollection.cs
- DetailsViewPagerRow.cs
- FromReply.cs
- XAMLParseException.cs
- BuildResult.cs
- LogFlushAsyncResult.cs
- CultureInfo.cs
- SourceFileBuildProvider.cs
- MergeFailedEvent.cs
- OptionalMessageQuery.cs
- AnimationClock.cs
- WpfWebRequestHelper.cs
- SystemIPAddressInformation.cs
- ThemeConfigurationDialog.cs
- XPathAncestorQuery.cs
- QueryOutputWriter.cs
- Item.cs
- MemoryPressure.cs
- LineServices.cs
- ButtonFieldBase.cs
- ColumnTypeConverter.cs