Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Configuration / WebBaseEventKeyComparer.cs / 1 / 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
- DocumentXPathNavigator.cs
- WindowsSecurityToken.cs
- TreeNodeStyleCollection.cs
- ItemAutomationPeer.cs
- WasHttpHandlersInstallComponent.cs
- _ScatterGatherBuffers.cs
- DataGridViewRowPostPaintEventArgs.cs
- TransactionScope.cs
- Rules.cs
- Int64Storage.cs
- SessionEndingCancelEventArgs.cs
- ObjectListTitleAttribute.cs
- ArglessEventHandlerProxy.cs
- SynchronizationLockException.cs
- InternalControlCollection.cs
- ColorAnimationUsingKeyFrames.cs
- BinaryObjectInfo.cs
- WebUtil.cs
- ReturnType.cs
- ExpressionPrefixAttribute.cs
- TableSectionStyle.cs
- Animatable.cs
- RectValueSerializer.cs
- EventHandlerService.cs
- CodeAttributeDeclarationCollection.cs
- X509RawDataKeyIdentifierClause.cs
- Environment.cs
- DataObjectPastingEventArgs.cs
- SmtpDigestAuthenticationModule.cs
- KeyboardNavigation.cs
- CheckBoxFlatAdapter.cs
- AnnotationHighlightLayer.cs
- Tablet.cs
- HttpConfigurationSystem.cs
- AssemblyInfo.cs
- ChtmlMobileTextWriter.cs
- SessionStateItemCollection.cs
- TypeSystem.cs
- CAGDesigner.cs
- DataGridViewColumnEventArgs.cs
- XmlAttributeProperties.cs
- XmlBinaryReaderSession.cs
- CodeSubDirectoriesCollection.cs
- StorageAssociationSetMapping.cs
- ServiceProviders.cs
- CharAnimationBase.cs
- InvalidEnumArgumentException.cs
- SafeLibraryHandle.cs
- BitmapEffectInput.cs
- ExpressionDumper.cs
- StringPropertyBuilder.cs
- CdpEqualityComparer.cs
- TraceInternal.cs
- XmlSchemaObjectTable.cs
- x509store.cs
- NoClickablePointException.cs
- HandlerWithFactory.cs
- HttpCachePolicyElement.cs
- OutputCacheProfileCollection.cs
- HtmlInputHidden.cs
- FigureParaClient.cs
- BooleanAnimationBase.cs
- StyleCollectionEditor.cs
- EasingFunctionBase.cs
- EmbeddedMailObjectsCollection.cs
- ProtocolsConfiguration.cs
- WorkflowInstanceProxy.cs
- WizardPanel.cs
- PeerNameRecordCollection.cs
- HeaderedItemsControl.cs
- SchemaCreator.cs
- Vector3DCollectionValueSerializer.cs
- UnmanagedMemoryStreamWrapper.cs
- ProxyManager.cs
- ProfileEventArgs.cs
- TemplateControlCodeDomTreeGenerator.cs
- SafeRightsManagementSessionHandle.cs
- CircleHotSpot.cs
- ExpressionBuilder.cs
- FrameAutomationPeer.cs
- DateTimeConverter2.cs
- ConsoleKeyInfo.cs
- DataControlImageButton.cs
- AnnotationService.cs
- SafeFileHandle.cs
- StyleModeStack.cs
- HttpListener.cs
- BooleanAnimationBase.cs
- DbMetaDataFactory.cs
- EventItfInfo.cs
- XPathNodePointer.cs
- Menu.cs
- SqlClientWrapperSmiStream.cs
- AssertFilter.cs
- AncillaryOps.cs
- SqlDataSource.cs
- Subset.cs
- Int64Animation.cs
- XmlSchemaComplexContentExtension.cs
- SqlTypeSystemProvider.cs