Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Serialization / NameTable.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SymmetricKey.cs
- ConfigurationElementCollection.cs
- BevelBitmapEffect.cs
- CallbackValidatorAttribute.cs
- RepeaterDataBoundAdapter.cs
- ResolveNameEventArgs.cs
- configsystem.cs
- RouteItem.cs
- Soap11ServerProtocol.cs
- SHA512CryptoServiceProvider.cs
- HandlerWithFactory.cs
- RegexWorker.cs
- PropertyInformationCollection.cs
- WaitForChangedResult.cs
- CqlWriter.cs
- BamlLocalizer.cs
- PieceDirectory.cs
- CodeDirectionExpression.cs
- GB18030Encoding.cs
- NoneExcludedImageIndexConverter.cs
- ButtonFieldBase.cs
- RequiredFieldValidator.cs
- ScriptResourceInfo.cs
- ServiceOperationListItem.cs
- WindowsImpersonationContext.cs
- DocumentsTrace.cs
- BitmapEffectOutputConnector.cs
- Mapping.cs
- invalidudtexception.cs
- ThicknessAnimation.cs
- TimerEventSubscriptionCollection.cs
- WebReferencesBuildProvider.cs
- MarkupWriter.cs
- XsltException.cs
- DbConnectionOptions.cs
- RawStylusInput.cs
- LayoutUtils.cs
- AppLevelCompilationSectionCache.cs
- EventMappingSettingsCollection.cs
- BinaryExpressionHelper.cs
- TableLayoutPanelCellPosition.cs
- CodeIndexerExpression.cs
- HMACRIPEMD160.cs
- StackOverflowException.cs
- DBConnection.cs
- ObfuscateAssemblyAttribute.cs
- ExpressionBuilderContext.cs
- ButtonFlatAdapter.cs
- TraceHandlerErrorFormatter.cs
- ParseChildrenAsPropertiesAttribute.cs
- DeferredElementTreeState.cs
- AspCompat.cs
- Pens.cs
- InfoCardProofToken.cs
- X509ThumbprintKeyIdentifierClause.cs
- CSharpCodeProvider.cs
- TextBox.cs
- CodeCompiler.cs
- FragmentQueryKB.cs
- PointAnimation.cs
- ADRoleFactoryConfiguration.cs
- BinaryFormatter.cs
- ObjectStorage.cs
- ProxyWebPartManager.cs
- EventWaitHandleSecurity.cs
- URIFormatException.cs
- StorageFunctionMapping.cs
- ListManagerBindingsCollection.cs
- DrawingContextWalker.cs
- infer.cs
- SafeLibraryHandle.cs
- TextContainerChangedEventArgs.cs
- ExistsInCollection.cs
- BindingListCollectionView.cs
- MultiBindingExpression.cs
- PlatformCulture.cs
- DynamicPropertyHolder.cs
- ResourceExpressionBuilder.cs
- ConnectionProviderAttribute.cs
- BoolLiteral.cs
- AuthenticateEventArgs.cs
- TextElement.cs
- FocusWithinProperty.cs
- AttributeQuery.cs
- StringInfo.cs
- OleDbRowUpdatedEvent.cs
- InputScopeAttribute.cs
- FileUpload.cs
- ClientApiGenerator.cs
- RegexWorker.cs
- WSHttpSecurity.cs
- X509CertificateCollection.cs
- ChannelParameterCollection.cs
- CancellationState.cs
- XmlSchemaAny.cs
- BitmapDownload.cs
- TagMapCollection.cs
- CollectionConverter.cs
- TypeConstant.cs
- SqlCaseSimplifier.cs