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
- RepeaterItemEventArgs.cs
- Opcode.cs
- PrimitiveType.cs
- ConstantExpression.cs
- FontStretch.cs
- webclient.cs
- RadialGradientBrush.cs
- WebConfigurationHostFileChange.cs
- MetadataUtil.cs
- RecordManager.cs
- BamlRecordWriter.cs
- PackUriHelper.cs
- LocalServiceSecuritySettings.cs
- TextMarkerSource.cs
- PropertyInformation.cs
- FlowLayoutPanel.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- Path.cs
- MemberInfoSerializationHolder.cs
- Util.cs
- SrgsSubset.cs
- FacetValues.cs
- TrustLevelCollection.cs
- OutputCacheModule.cs
- Table.cs
- TreeNodeCollection.cs
- DoubleIndependentAnimationStorage.cs
- PropertyPathWorker.cs
- Misc.cs
- ProgressChangedEventArgs.cs
- MexHttpsBindingElement.cs
- StateWorkerRequest.cs
- DataGridViewColumnHeaderCell.cs
- FamilyMapCollection.cs
- DataGridItemCollection.cs
- HMACSHA384.cs
- ObjectDataProvider.cs
- TaiwanCalendar.cs
- Constraint.cs
- TrackBarDesigner.cs
- CacheMode.cs
- FieldToken.cs
- GetMemberBinder.cs
- WindowsEditBox.cs
- NotificationContext.cs
- DataSet.cs
- BoolLiteral.cs
- FlatButtonAppearance.cs
- PowerModeChangedEventArgs.cs
- AsyncStreamReader.cs
- exports.cs
- TypeUtil.cs
- TypeInitializationException.cs
- Page.cs
- CodeSubDirectoriesCollection.cs
- OdbcEnvironment.cs
- DeadCharTextComposition.cs
- ListControl.cs
- Sql8ExpressionRewriter.cs
- HostUtils.cs
- FirstMatchCodeGroup.cs
- HierarchicalDataBoundControl.cs
- Int32Rect.cs
- Nullable.cs
- HatchBrush.cs
- ImageSource.cs
- userdatakeys.cs
- XhtmlBasicValidationSummaryAdapter.cs
- ModuleBuilder.cs
- XmlSchemaObject.cs
- ExceptionHandlersDesigner.cs
- InternalConfigRoot.cs
- QueryExecutionOption.cs
- SqlCrossApplyToCrossJoin.cs
- OleDbException.cs
- Mutex.cs
- CompletedAsyncResult.cs
- AutomationPropertyChangedEventArgs.cs
- UrlAuthorizationModule.cs
- VisualTreeHelper.cs
- Vars.cs
- OutOfProcStateClientManager.cs
- SelectionGlyph.cs
- ExeConfigurationFileMap.cs
- HostingEnvironmentSection.cs
- CompilerHelpers.cs
- PathData.cs
- AsymmetricKeyExchangeDeformatter.cs
- CriticalFinalizerObject.cs
- Win32Native.cs
- TrackingProfileDeserializationException.cs
- MessagePropertyFilter.cs
- WebSysDisplayNameAttribute.cs
- OleDbSchemaGuid.cs
- HitTestParameters3D.cs
- RotateTransform3D.cs
- ExceptionUtility.cs
- DesignerForm.cs
- HttpContext.cs
- DataAdapter.cs