Code:
/ FX-1434 / FX-1434 / 1.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
- EventLogLink.cs
- NativeCppClassAttribute.cs
- SmtpCommands.cs
- JsonEncodingStreamWrapper.cs
- VoiceSynthesis.cs
- Queue.cs
- LogLogRecordHeader.cs
- UIElement.cs
- Matrix3DValueSerializer.cs
- HandleCollector.cs
- OracleBoolean.cs
- HtmlHead.cs
- Convert.cs
- WebPartMovingEventArgs.cs
- OracleParameterBinding.cs
- BinaryObjectInfo.cs
- ChannelSettingsElement.cs
- IDQuery.cs
- StatusBar.cs
- DiscriminatorMap.cs
- FixedPageProcessor.cs
- KeyPullup.cs
- PersonalizationStateQuery.cs
- NameTable.cs
- DataExpression.cs
- DataGridViewCellMouseEventArgs.cs
- MemoryFailPoint.cs
- Empty.cs
- WorkflowDefinitionDispenser.cs
- EventLogSession.cs
- ProgressBar.cs
- MaskedTextBoxDesignerActionList.cs
- CodeTypeParameterCollection.cs
- CheckedPointers.cs
- SafeTimerHandle.cs
- ReaderOutput.cs
- DetailsViewPagerRow.cs
- Triplet.cs
- AmbientProperties.cs
- TimeSpanStorage.cs
- ExecutionEngineException.cs
- RoutingTable.cs
- HeaderedItemsControl.cs
- WebPartVerb.cs
- Asn1IntegerConverter.cs
- SQLInt64Storage.cs
- BlobPersonalizationState.cs
- GenericPrincipal.cs
- DocumentPageTextView.cs
- StaticSiteMapProvider.cs
- QilStrConcatenator.cs
- ItemList.cs
- XmlSerializerVersionAttribute.cs
- PublishLicense.cs
- IntPtr.cs
- PersonalizationProviderHelper.cs
- Link.cs
- XmlSchemaDatatype.cs
- OleDbReferenceCollection.cs
- TcpPortSharing.cs
- SqlServer2KCompatibilityAnnotation.cs
- CodeDelegateInvokeExpression.cs
- DomainUpDown.cs
- OleDbMetaDataFactory.cs
- _HeaderInfoTable.cs
- EncodedStreamFactory.cs
- ThicknessAnimationUsingKeyFrames.cs
- TextServicesManager.cs
- ArrayExtension.cs
- CodeGroup.cs
- DelegatingMessage.cs
- BStrWrapper.cs
- BitmapEffectDrawingContent.cs
- UpdatePanelTrigger.cs
- HatchBrush.cs
- FieldDescriptor.cs
- MetadataSource.cs
- IODescriptionAttribute.cs
- XmlCDATASection.cs
- AddInProcess.cs
- DateTimeFormatInfo.cs
- CaretElement.cs
- SafeFindHandle.cs
- DataTableMappingCollection.cs
- WindowsPrincipal.cs
- __Filters.cs
- ObsoleteAttribute.cs
- Compilation.cs
- XPathArrayIterator.cs
- XamlTemplateSerializer.cs
- LoadGrammarCompletedEventArgs.cs
- LogicalExpr.cs
- FixedDocumentSequencePaginator.cs
- AssemblyAttributes.cs
- xsdvalidator.cs
- TabRenderer.cs
- PrintControllerWithStatusDialog.cs
- XsdSchemaFileEditor.cs
- RoleManagerEventArgs.cs
- OdbcReferenceCollection.cs