Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / WebBaseEventKeyComparer.cs / 1305376 / WebBaseEventKeyComparer.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Hosting; using System.Web.Util; using System.Web.Configuration; using System.Web.Management; using System.Web.Compilation; internal class WebBaseEventKeyComparer : IEqualityComparer { public new bool Equals(object x, object y) { CustomWebEventKey xKey = (CustomWebEventKey)x; CustomWebEventKey yKey = (CustomWebEventKey)y; if (xKey._eventCode == yKey._eventCode && xKey._type.Equals(yKey._type)) { return true; } return false; } public int GetHashCode(object obj) { return ((CustomWebEventKey)obj)._eventCode ^ ((CustomWebEventKey)obj)._type.GetHashCode(); } public int Compare(object x, object y) { CustomWebEventKey xKey = (CustomWebEventKey)x; CustomWebEventKey yKey = (CustomWebEventKey)y; int xEventCode = xKey._eventCode; int yEventCode = yKey._eventCode; if (xEventCode == yEventCode) { Type xType = xKey._type; Type yType = yKey._type; if (xType.Equals(yType)) { return 0; } else { return Comparer.Default.Compare(xType.ToString(), yType.ToString()); } } else { if (xEventCode > yEventCode) { return 1; } else { return -1; } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Hosting; using System.Web.Util; using System.Web.Configuration; using System.Web.Management; using System.Web.Compilation; internal class WebBaseEventKeyComparer : IEqualityComparer { public new bool Equals(object x, object y) { CustomWebEventKey xKey = (CustomWebEventKey)x; CustomWebEventKey yKey = (CustomWebEventKey)y; if (xKey._eventCode == yKey._eventCode && xKey._type.Equals(yKey._type)) { return true; } return false; } public int GetHashCode(object obj) { return ((CustomWebEventKey)obj)._eventCode ^ ((CustomWebEventKey)obj)._type.GetHashCode(); } public int Compare(object x, object y) { CustomWebEventKey xKey = (CustomWebEventKey)x; CustomWebEventKey yKey = (CustomWebEventKey)y; int xEventCode = xKey._eventCode; int yEventCode = yKey._eventCode; if (xEventCode == yEventCode) { Type xType = xKey._type; Type yType = yKey._type; if (xType.Equals(yType)) { return 0; } else { return Comparer.Default.Compare(xType.ToString(), yType.ToString()); } } else { if (xEventCode > yEventCode) { return 1; } else { return -1; } } } } } // 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
- OraclePermissionAttribute.cs
- TypedTableBaseExtensions.cs
- GuidTagList.cs
- ClassData.cs
- QuadraticBezierSegment.cs
- BuildProvider.cs
- XmlEncodedRawTextWriter.cs
- EmptyReadOnlyDictionaryInternal.cs
- XsdSchemaFileEditor.cs
- SystemColorTracker.cs
- ObjRef.cs
- HostProtectionException.cs
- DataFieldConverter.cs
- IfAction.cs
- _IPv6Address.cs
- SolidColorBrush.cs
- CheckedPointers.cs
- PrimitiveCodeDomSerializer.cs
- TraceContextEventArgs.cs
- TogglePattern.cs
- NotFiniteNumberException.cs
- RangeValuePattern.cs
- DetailsViewDeleteEventArgs.cs
- HttpBindingExtension.cs
- PropertyOrder.cs
- TransformerInfo.cs
- BamlTreeMap.cs
- FormsAuthentication.cs
- DataGridViewTopRowAccessibleObject.cs
- MultiViewDesigner.cs
- PolyQuadraticBezierSegment.cs
- EtwTrace.cs
- PageParser.cs
- IndexerNameAttribute.cs
- QilLoop.cs
- LogicalExpr.cs
- SecurityElement.cs
- TableAutomationPeer.cs
- EnglishPluralizationService.cs
- Single.cs
- DictionaryBase.cs
- WebZoneDesigner.cs
- Array.cs
- ChannelManager.cs
- ObjectNavigationPropertyMapping.cs
- Types.cs
- SignedXml.cs
- RegisteredHiddenField.cs
- SimpleWebHandlerParser.cs
- TextEffectResolver.cs
- XamlPointCollectionSerializer.cs
- ListViewDeleteEventArgs.cs
- WriteableBitmap.cs
- securitycriticaldataformultiplegetandset.cs
- BitVec.cs
- VisemeEventArgs.cs
- XmlLinkedNode.cs
- NetMsmqBinding.cs
- ImmutableCollection.cs
- SerialStream.cs
- PaintValueEventArgs.cs
- ChtmlImageAdapter.cs
- DataTableReaderListener.cs
- StorageMappingItemCollection.cs
- LinearGradientBrush.cs
- hebrewshape.cs
- CollectionChangeEventArgs.cs
- FileDialog_Vista_Interop.cs
- CombinedGeometry.cs
- basecomparevalidator.cs
- ScriptModule.cs
- OledbConnectionStringbuilder.cs
- FreezableOperations.cs
- SafeLibraryHandle.cs
- Overlapped.cs
- ParsedRoute.cs
- SqlTriggerContext.cs
- EventsTab.cs
- StorageAssociationSetMapping.cs
- InputScopeConverter.cs
- BaseResourcesBuildProvider.cs
- ProfileModule.cs
- XmlHierarchyData.cs
- FileNotFoundException.cs
- ResizingMessageFilter.cs
- MethodImplAttribute.cs
- ClientSideProviderDescription.cs
- TypeValidationEventArgs.cs
- XmlSchemaSimpleType.cs
- Perspective.cs
- SchemaElementLookUpTableEnumerator.cs
- ButtonBase.cs
- FigureParagraph.cs
- PreparingEnlistment.cs
- EncodingNLS.cs
- StringUtil.cs
- IIS7UserPrincipal.cs
- MaskPropertyEditor.cs
- DetailsViewRow.cs
- QueryReaderSettings.cs