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
- BooleanExpr.cs
- TextStore.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- RelationshipEndCollection.cs
- TableCellCollection.cs
- SessionParameter.cs
- StringFunctions.cs
- PointUtil.cs
- MsiStyleLogWriter.cs
- ChildrenQuery.cs
- TriggerCollection.cs
- ArrayElementGridEntry.cs
- TabItemWrapperAutomationPeer.cs
- ByteAnimationUsingKeyFrames.cs
- SqlComparer.cs
- StringTraceRecord.cs
- PrintSchema.cs
- VideoDrawing.cs
- Form.cs
- UserMapPath.cs
- TextBoxBase.cs
- ConvertEvent.cs
- DeclaredTypeValidatorAttribute.cs
- ConstraintManager.cs
- OdbcCommand.cs
- EncodingTable.cs
- SafeEventLogWriteHandle.cs
- DataPagerCommandEventArgs.cs
- DesignOnlyAttribute.cs
- SizeValueSerializer.cs
- MarkupCompilePass2.cs
- ThrowHelper.cs
- SqlXmlStorage.cs
- GeneralTransform3D.cs
- ValidationErrorEventArgs.cs
- ContextMenu.cs
- ScrollBarRenderer.cs
- CultureInfoConverter.cs
- XmlChildEnumerator.cs
- CodeDirectiveCollection.cs
- DataViewListener.cs
- Attributes.cs
- TreeView.cs
- HyperLink.cs
- RequestSecurityTokenResponse.cs
- GenericEnumConverter.cs
- DomainLiteralReader.cs
- WorkflowMessageEventHandler.cs
- GridViewColumnHeader.cs
- RtfFormatStack.cs
- MissingManifestResourceException.cs
- FilteredDataSetHelper.cs
- BlurEffect.cs
- ScriptReference.cs
- ColorMap.cs
- BindingSource.cs
- ObjectSpanRewriter.cs
- RMPublishingDialog.cs
- LogicalExpressionEditor.cs
- XamlTemplateSerializer.cs
- cookiecontainer.cs
- AdRotator.cs
- SoapAttributeOverrides.cs
- ProxyGenerator.cs
- ProtectedUri.cs
- ArrayElementGridEntry.cs
- MinimizableAttributeTypeConverter.cs
- SingleObjectCollection.cs
- UIElementHelper.cs
- PagedDataSource.cs
- BitSet.cs
- GroupBox.cs
- Registry.cs
- TextFormatterHost.cs
- XmlWellformedWriter.cs
- TranslateTransform3D.cs
- SymmetricAlgorithm.cs
- _NativeSSPI.cs
- CodeDelegateCreateExpression.cs
- SecurityKeyUsage.cs
- ClonableStack.cs
- CharAnimationBase.cs
- DataGridViewCell.cs
- DrawingAttributes.cs
- RelatedView.cs
- ProcessModuleDesigner.cs
- DecimalConverter.cs
- StubHelpers.cs
- NonParentingControl.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- BypassElement.cs
- ObjectViewEntityCollectionData.cs
- DecoderExceptionFallback.cs
- DataStreams.cs
- MultipleViewProviderWrapper.cs
- SchemaType.cs
- ServiceActivationException.cs
- MethodCallConverter.cs
- NullableDecimalAverageAggregationOperator.cs
- InstanceDataCollection.cs