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
- FastPropertyAccessor.cs
- TcpDuplicateContext.cs
- OracleLob.cs
- TrimSurroundingWhitespaceAttribute.cs
- QilStrConcatenator.cs
- DynamicMetaObjectBinder.cs
- UpdateRecord.cs
- DbConnectionStringCommon.cs
- CodePrimitiveExpression.cs
- PathFigure.cs
- SmtpNegotiateAuthenticationModule.cs
- SimplePropertyEntry.cs
- Image.cs
- AppSettingsReader.cs
- UriSection.cs
- StoreItemCollection.Loader.cs
- MenuRendererStandards.cs
- SequentialUshortCollection.cs
- Button.cs
- SQLByte.cs
- ElementNotEnabledException.cs
- ScriptMethodAttribute.cs
- EncodingDataItem.cs
- ChannelParameterCollection.cs
- DataSourceBooleanViewSchemaConverter.cs
- UITypeEditors.cs
- ProcessMessagesAsyncResult.cs
- UntrustedRecipientException.cs
- ProfileService.cs
- CollectionView.cs
- KeyedCollection.cs
- ArrangedElement.cs
- CssTextWriter.cs
- SchemaInfo.cs
- unitconverter.cs
- AutoGeneratedFieldProperties.cs
- ScriptControlDescriptor.cs
- GeneralTransform2DTo3DTo2D.cs
- PassportPrincipal.cs
- PenCursorManager.cs
- TransactionTraceIdentifier.cs
- ItemCheckedEvent.cs
- ValuePatternIdentifiers.cs
- MergeFilterQuery.cs
- SSmlParser.cs
- WorkflowViewManager.cs
- CannotUnloadAppDomainException.cs
- PeerResolverElement.cs
- SpecularMaterial.cs
- ListViewItemSelectionChangedEvent.cs
- IFormattable.cs
- TreeIterator.cs
- loginstatus.cs
- DateTimeEditor.cs
- BamlResourceDeserializer.cs
- BooleanSwitch.cs
- SiteMapNodeItem.cs
- SortedDictionary.cs
- WebResponse.cs
- TemplateKeyConverter.cs
- HttpCachePolicy.cs
- MediaPlayerState.cs
- UTF8Encoding.cs
- Vector3D.cs
- AutoGeneratedFieldProperties.cs
- Optimizer.cs
- HtmlTableCell.cs
- CompilationRelaxations.cs
- DockAndAnchorLayout.cs
- OSFeature.cs
- SessionStateUtil.cs
- SoapIncludeAttribute.cs
- DbDataReader.cs
- RuntimeConfig.cs
- SettingsPropertyIsReadOnlyException.cs
- Region.cs
- QueryActivatableWorkflowsCommand.cs
- ColorKeyFrameCollection.cs
- SqlVersion.cs
- VerificationAttribute.cs
- ScaleTransform.cs
- BamlRecordHelper.cs
- SparseMemoryStream.cs
- XmlDataLoader.cs
- CodeIndexerExpression.cs
- Base64Decoder.cs
- PointCollection.cs
- BookmarkScope.cs
- MethodBuilderInstantiation.cs
- coordinator.cs
- DiscoveryVersionConverter.cs
- ThrowHelper.cs
- SafeRegistryHandle.cs
- TraceListener.cs
- PageAction.cs
- RegisteredDisposeScript.cs
- ResourceAttributes.cs
- TypeListConverter.cs
- SafeEventLogWriteHandle.cs
- PolicyValidationException.cs