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
- DoubleAnimationUsingPath.cs
- DataService.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- RelationshipSet.cs
- srgsitem.cs
- XmlCharCheckingReader.cs
- RootAction.cs
- xml.cs
- ServiceObjectContainer.cs
- BamlRecordHelper.cs
- HierarchicalDataBoundControlAdapter.cs
- Executor.cs
- Pointer.cs
- TraceRecord.cs
- ImageAnimator.cs
- FormattedTextSymbols.cs
- sqlpipe.cs
- Root.cs
- HostSecurityManager.cs
- HtmlInputControl.cs
- FlowLayoutSettings.cs
- DesignerForm.cs
- SplitContainerDesigner.cs
- EntityDataSourceReferenceGroup.cs
- UrlPath.cs
- CodeNamespaceCollection.cs
- GenerateScriptTypeAttribute.cs
- UriTemplateLiteralPathSegment.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- LinearGradientBrush.cs
- CompilerWrapper.cs
- PackageDigitalSignature.cs
- AnimationClock.cs
- AnnotationResourceCollection.cs
- DataGrid.cs
- dataprotectionpermissionattribute.cs
- FontFamily.cs
- FrameworkElementFactoryMarkupObject.cs
- ScopedMessagePartSpecification.cs
- PathSegment.cs
- MetadataUtil.cs
- AvTraceDetails.cs
- PkcsMisc.cs
- MenuItemStyleCollection.cs
- ResolveMatchesMessageCD1.cs
- ComponentResourceKeyConverter.cs
- Literal.cs
- AsyncOperationManager.cs
- BrowserCapabilitiesFactoryBase.cs
- SoapSchemaMember.cs
- DataSvcMapFile.cs
- SynchronizationContext.cs
- XmlArrayItemAttributes.cs
- KeyNotFoundException.cs
- ServiceChannelManager.cs
- WebPartConnectVerb.cs
- SHA512Managed.cs
- CalculatedColumn.cs
- SerializationSectionGroup.cs
- WebAdminConfigurationHelper.cs
- Regex.cs
- QilTargetType.cs
- DateTime.cs
- TextBoxRenderer.cs
- DuplicateWaitObjectException.cs
- DataServiceException.cs
- HttpRequestTraceRecord.cs
- CodeMemberField.cs
- Baml2006KeyRecord.cs
- UriTemplateHelpers.cs
- TypeTypeConverter.cs
- AnimationTimeline.cs
- MobileTemplatedControlDesigner.cs
- FragmentQueryProcessor.cs
- ManualResetEvent.cs
- CompilationUtil.cs
- ByteStreamMessageEncoderFactory.cs
- TraceFilter.cs
- ValueCollectionParameterReader.cs
- InputReferenceExpression.cs
- InvalidProgramException.cs
- StringExpressionSet.cs
- FixedSOMTable.cs
- ClosableStream.cs
- Activity.cs
- IntSecurity.cs
- XmlComplianceUtil.cs
- GlobalizationAssembly.cs
- HtmlInputText.cs
- SmtpTransport.cs
- FakeModelItemImpl.cs
- DesignerPainter.cs
- PropertyConverter.cs
- KeyGestureConverter.cs
- wgx_commands.cs
- WindowsClientCredential.cs
- HotCommands.cs
- ExpressionBuilderContext.cs
- DataGridItemEventArgs.cs
- WindowsListViewGroupSubsetLink.cs