Code:
/ DotNET / DotNET / 8.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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IndentTextWriter.cs
- XmlSchemaIdentityConstraint.cs
- WsatServiceAddress.cs
- ForwardPositionQuery.cs
- DecoderReplacementFallback.cs
- PackWebResponse.cs
- SQLInt16Storage.cs
- WorkflowOperationContext.cs
- SHA384.cs
- BitmapData.cs
- PathFigureCollectionConverter.cs
- CreateRefExpr.cs
- UIntPtr.cs
- BlurEffect.cs
- ErrorStyle.cs
- GroupLabel.cs
- ModelItem.cs
- RegistryPermission.cs
- OleDbException.cs
- CompositeControl.cs
- FaultDesigner.cs
- Menu.cs
- Html32TextWriter.cs
- ActivityDesigner.cs
- EntityCommand.cs
- ExpandSegment.cs
- CapabilitiesState.cs
- StringFormat.cs
- SafeHandles.cs
- DataBoundControlHelper.cs
- ProgressBarHighlightConverter.cs
- CollectionViewGroupRoot.cs
- Shape.cs
- SecurityTokenException.cs
- Comparer.cs
- Cursor.cs
- Label.cs
- TakeQueryOptionExpression.cs
- DataIdProcessor.cs
- QueryStringParameter.cs
- ContractMethodParameterInfo.cs
- CodeSnippetCompileUnit.cs
- HttpPostClientProtocol.cs
- EditorBrowsableAttribute.cs
- SystemWebCachingSectionGroup.cs
- TlsnegoTokenProvider.cs
- CodeEventReferenceExpression.cs
- SByteConverter.cs
- Stackframe.cs
- ETagAttribute.cs
- storepermissionattribute.cs
- SafeThemeHandle.cs
- ZipPackage.cs
- ExceptionHandlerDesigner.cs
- UrlRoutingHandler.cs
- METAHEADER.cs
- FormsAuthenticationUser.cs
- WebPartsPersonalizationAuthorization.cs
- TemplateControl.cs
- iisPickupDirectory.cs
- AttachmentCollection.cs
- PositiveTimeSpanValidator.cs
- InvalidateEvent.cs
- EventLogPermissionAttribute.cs
- WithParamAction.cs
- embossbitmapeffect.cs
- HitTestDrawingContextWalker.cs
- CodeAccessPermission.cs
- WindowsAuthenticationModule.cs
- MenuStrip.cs
- Geometry.cs
- DesignerSerializationOptionsAttribute.cs
- StrongNameIdentityPermission.cs
- DetailsViewCommandEventArgs.cs
- TextEncodedRawTextWriter.cs
- TextSerializer.cs
- PointValueSerializer.cs
- VersionPair.cs
- ContainerFilterService.cs
- ReflectionPermission.cs
- ArraySubsetEnumerator.cs
- NamespaceInfo.cs
- MsmqVerifier.cs
- BuildManager.cs
- GridViewUpdateEventArgs.cs
- KeyboardDevice.cs
- XhtmlBasicTextBoxAdapter.cs
- QueryExtender.cs
- ListBoxItem.cs
- ExtractedStateEntry.cs
- TypeLibConverter.cs
- SetStateDesigner.cs
- StreamGeometryContext.cs
- CompilationPass2TaskInternal.cs
- Filter.cs
- TextDecorationLocationValidation.cs
- Parameter.cs
- ScrollData.cs
- SqlRecordBuffer.cs
- FunctionOverloadResolver.cs