Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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
- XsltInput.cs
- ProtectedProviderSettings.cs
- EntitySetBaseCollection.cs
- Renderer.cs
- SerializerWriterEventHandlers.cs
- DataGridCommandEventArgs.cs
- IntSecurity.cs
- FrameDimension.cs
- WindowsListViewGroup.cs
- SpeechRecognizer.cs
- RegexMatch.cs
- CryptoApi.cs
- SqlDelegatedTransaction.cs
- Html32TextWriter.cs
- ListenerSingletonConnectionReader.cs
- ConfigUtil.cs
- Bitmap.cs
- FormParameter.cs
- OptimalBreakSession.cs
- ElementAction.cs
- MDIControlStrip.cs
- CharEnumerator.cs
- WpfPayload.cs
- RightsManagementEncryptionTransform.cs
- AsyncCompletedEventArgs.cs
- ArrayTypeMismatchException.cs
- AutoGeneratedFieldProperties.cs
- GridViewDeleteEventArgs.cs
- ComplusEndpointConfigContainer.cs
- DirectionalLight.cs
- StandardToolWindows.cs
- TypeResolver.cs
- SqlConnectionStringBuilder.cs
- HMACSHA1.cs
- InheritanceContextChangedEventManager.cs
- PreProcessor.cs
- EventHandlersDesigner.cs
- LedgerEntry.cs
- CodeSnippetCompileUnit.cs
- SafeMarshalContext.cs
- DrawListViewItemEventArgs.cs
- AutomationPeer.cs
- LayoutSettings.cs
- MeshGeometry3D.cs
- DesignerActionKeyboardBehavior.cs
- StylusOverProperty.cs
- TagNameToTypeMapper.cs
- RadioButtonList.cs
- Path.cs
- ConstrainedDataObject.cs
- Parser.cs
- DesignerResources.cs
- XLinq.cs
- CustomCredentialPolicy.cs
- XmlTextReaderImpl.cs
- Int64Storage.cs
- ReflectPropertyDescriptor.cs
- Dictionary.cs
- SR.cs
- PrtCap_Builder.cs
- RemoteArgument.cs
- RelationshipWrapper.cs
- ImportedNamespaceContextItem.cs
- ProcessModuleCollection.cs
- lengthconverter.cs
- FunctionOverloadResolver.cs
- DataBindingExpressionBuilder.cs
- ComplexBindingPropertiesAttribute.cs
- RectangleGeometry.cs
- DeflateEmulationStream.cs
- Predicate.cs
- TrackingServices.cs
- DecimalStorage.cs
- AsymmetricSignatureDeformatter.cs
- PackWebRequestFactory.cs
- DataError.cs
- CharacterBuffer.cs
- CustomCredentialPolicy.cs
- NeedSkipTokenVisitor.cs
- PreviewPageInfo.cs
- PropertyStore.cs
- EntityCollectionChangedParams.cs
- StorageModelBuildProvider.cs
- WindowsTreeView.cs
- InputLanguageProfileNotifySink.cs
- Int32AnimationUsingKeyFrames.cs
- SymbolType.cs
- DecimalConstantAttribute.cs
- ClientUtils.cs
- ProviderSettingsCollection.cs
- DictionaryBase.cs
- PointIndependentAnimationStorage.cs
- DbConnectionPoolCounters.cs
- CodeDelegateCreateExpression.cs
- TableLayoutStyle.cs
- SerializationAttributes.cs
- XPathDocumentNavigator.cs
- IERequestCache.cs
- RequestBringIntoViewEventArgs.cs
- RuleSettings.cs