Code:
/ FX-1434 / FX-1434 / 1.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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RealProxy.cs
- MailDefinition.cs
- ValueTypeFixupInfo.cs
- FactoryGenerator.cs
- ManagedIStream.cs
- SiteMapDataSource.cs
- HtmlElementErrorEventArgs.cs
- BitmapEffectGroup.cs
- CodeDirectiveCollection.cs
- StrokeNodeOperations2.cs
- SqlDataReaderSmi.cs
- XmlSchemaSimpleContent.cs
- CodeGotoStatement.cs
- GlyphRun.cs
- SmiRecordBuffer.cs
- RoleService.cs
- Vector3DCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SqlDataReader.cs
- PictureBoxDesigner.cs
- RootBrowserWindow.cs
- DefaultTraceListener.cs
- IssuedTokenServiceElement.cs
- Attribute.cs
- XmlSchemaSequence.cs
- RsaKeyIdentifierClause.cs
- PhoneCallDesigner.cs
- Baml2006ReaderContext.cs
- IgnoreFileBuildProvider.cs
- TempFiles.cs
- WizardForm.cs
- StringExpressionSet.cs
- LinkLabel.cs
- ObjectParameterCollection.cs
- CommandLineParser.cs
- XPathSelectionIterator.cs
- DataGridColumnHeaderCollection.cs
- Rotation3DKeyFrameCollection.cs
- SqlProcedureAttribute.cs
- XamlStream.cs
- ToolStripSplitStackLayout.cs
- LineUtil.cs
- BufferedWebEventProvider.cs
- HierarchicalDataBoundControl.cs
- ContentControl.cs
- DoubleAnimationClockResource.cs
- DirtyTextRange.cs
- XhtmlBasicValidatorAdapter.cs
- SapiGrammar.cs
- GetRecipientListRequest.cs
- validation.cs
- EventsTab.cs
- ExpressionConverter.cs
- JsonSerializer.cs
- BufferModeSettings.cs
- ConfigurationPermission.cs
- TextBoxBase.cs
- AttributeXamlType.cs
- ValueOfAction.cs
- PresentationUIStyleResources.cs
- dtdvalidator.cs
- CheckoutException.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- WebPartZone.cs
- HostProtectionException.cs
- ScriptHandlerFactory.cs
- IPAddressCollection.cs
- SystemIPInterfaceStatistics.cs
- FormsAuthenticationCredentials.cs
- DataGridViewColumnCollection.cs
- Part.cs
- TrustExchangeException.cs
- WebPartTransformerCollection.cs
- SmtpNegotiateAuthenticationModule.cs
- FtpCachePolicyElement.cs
- DataRowChangeEvent.cs
- PageCatalogPart.cs
- SubtreeProcessor.cs
- DrawingGroupDrawingContext.cs
- CompilerErrorCollection.cs
- DataGridViewRowStateChangedEventArgs.cs
- InlineCategoriesDocument.cs
- UnionCodeGroup.cs
- XmlCharCheckingReader.cs
- TemplateParser.cs
- FileLoadException.cs
- CorrelationService.cs
- DataRowCollection.cs
- CommandHelpers.cs
- BinaryNode.cs
- DivideByZeroException.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- GenericRootAutomationPeer.cs
- DoubleCollection.cs
- DesignerTransaction.cs
- TableLayoutColumnStyleCollection.cs
- TableLayoutPanel.cs
- FormsAuthenticationEventArgs.cs
- SQLConvert.cs
- WinFormsComponentEditor.cs