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
- WasAdminWrapper.cs
- UserControlBuildProvider.cs
- CallContext.cs
- SafeNativeMethods.cs
- webclient.cs
- DataListItemEventArgs.cs
- NullableConverter.cs
- Tag.cs
- GeometryValueSerializer.cs
- StyleCollection.cs
- TrackingMemoryStreamFactory.cs
- ProxyManager.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- CategoryAttribute.cs
- WizardDesigner.cs
- RoleManagerModule.cs
- DNS.cs
- OleStrCAMarshaler.cs
- Rule.cs
- DataContract.cs
- SQLResource.cs
- UserControlParser.cs
- TextDocumentView.cs
- DocumentGridPage.cs
- wmiprovider.cs
- CallbackTimeoutsBehavior.cs
- EncoderBestFitFallback.cs
- DeleteHelper.cs
- XmlAttributes.cs
- ChangePassword.cs
- FormView.cs
- TransformerInfoCollection.cs
- MasterPageCodeDomTreeGenerator.cs
- TreeViewImageIndexConverter.cs
- invalidudtexception.cs
- XmlDataSource.cs
- RadioButtonRenderer.cs
- MailBnfHelper.cs
- RightsManagementInformation.cs
- IdnMapping.cs
- SQLDateTime.cs
- XmlArrayAttribute.cs
- DoubleAnimation.cs
- CollectionViewProxy.cs
- GridViewEditEventArgs.cs
- AttributeCollection.cs
- Timer.cs
- Registry.cs
- Graph.cs
- Int64Storage.cs
- SyndicationDeserializer.cs
- IsolatedStorageException.cs
- ContentControl.cs
- ProviderManager.cs
- InternalSafeNativeMethods.cs
- ExtensibleClassFactory.cs
- FormViewUpdatedEventArgs.cs
- Matrix3DStack.cs
- HebrewCalendar.cs
- SurrogateEncoder.cs
- EntityDataSourceUtil.cs
- TreeViewAutomationPeer.cs
- ServiceAuthorizationBehavior.cs
- IndependentlyAnimatedPropertyMetadata.cs
- UriTemplate.cs
- ProviderCommandInfoUtils.cs
- DbTransaction.cs
- SqlEnums.cs
- SelectionItemPattern.cs
- RowCache.cs
- WSTrustFeb2005.cs
- FileUtil.cs
- ArglessEventHandlerProxy.cs
- TimeSpanMinutesConverter.cs
- DateTimeOffsetStorage.cs
- ClientScriptManager.cs
- CurrencyManager.cs
- XmlDataSource.cs
- HostingEnvironmentWrapper.cs
- ControlDesigner.cs
- ListChangedEventArgs.cs
- XpsPartBase.cs
- AutoResetEvent.cs
- QueryFunctions.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- SoapSchemaImporter.cs
- PipelineDeploymentState.cs
- TemplateBindingExpression.cs
- QilUnary.cs
- SecurityDocument.cs
- ToolstripProfessionalRenderer.cs
- SqlDataSourceView.cs
- DrawingImage.cs
- PartManifestEntry.cs
- CreateDataSourceDialog.cs
- TypeValidationEventArgs.cs
- ToolStripPanelSelectionGlyph.cs
- BitmapMetadataBlob.cs
- Scene3D.cs
- CapacityStreamGeometryContext.cs