Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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;
}
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridCell.cs
- PerCallInstanceContextProvider.cs
- HttpApplication.cs
- PageCatalogPart.cs
- CustomSignedXml.cs
- ExternalException.cs
- ControlBuilderAttribute.cs
- PasswordRecovery.cs
- CopyOnWriteList.cs
- SafeEventLogWriteHandle.cs
- ElementHostAutomationPeer.cs
- SqlOuterApplyReducer.cs
- ButtonAutomationPeer.cs
- OleDbRowUpdatedEvent.cs
- ToolStripItemImageRenderEventArgs.cs
- ConfigurationPropertyAttribute.cs
- ErrorStyle.cs
- NativeMethods.cs
- ArgIterator.cs
- TitleStyle.cs
- AssociationTypeEmitter.cs
- MsmqInputChannelListener.cs
- SafeArrayRankMismatchException.cs
- TextRangeProviderWrapper.cs
- EdmType.cs
- OracleConnectionFactory.cs
- InkCanvas.cs
- LocationInfo.cs
- IsolatedStoragePermission.cs
- IDReferencePropertyAttribute.cs
- DesignTimeParseData.cs
- StringReader.cs
- EntityConnection.cs
- UserUseLicenseDictionaryLoader.cs
- CodeCommentStatementCollection.cs
- ViewSimplifier.cs
- SoapAttributeAttribute.cs
- TrackingStringDictionary.cs
- Nullable.cs
- ConfigurationManagerInternalFactory.cs
- WindowsFormsHost.cs
- WinEventWrap.cs
- HtmlTitle.cs
- CompilerScope.cs
- IItemProperties.cs
- BatchWriter.cs
- StreamInfo.cs
- AnnotationHelper.cs
- TextBoxBase.cs
- TimeoutConverter.cs
- DataStorage.cs
- TabControl.cs
- StateWorkerRequest.cs
- XmlSchemaValidator.cs
- WebPartCatalogCloseVerb.cs
- SqlXmlStorage.cs
- SpoolingTaskBase.cs
- GraphicsState.cs
- GeneralTransform3DTo2DTo3D.cs
- SrgsElementFactory.cs
- MetaTable.cs
- WindowsGraphicsWrapper.cs
- XmlSchemaType.cs
- CacheForPrimitiveTypes.cs
- GraphicsContext.cs
- SqlClientWrapperSmiStreamChars.cs
- NamedPipeConnectionPoolSettings.cs
- FixedBufferAttribute.cs
- ResourceExpression.cs
- DataObjectFieldAttribute.cs
- Signature.cs
- TextFormatterHost.cs
- QueryIntervalOp.cs
- ModelItemExtensions.cs
- PixelFormatConverter.cs
- XmlWhitespace.cs
- SoapHelper.cs
- AudioFormatConverter.cs
- CqlParserHelpers.cs
- CTreeGenerator.cs
- ReachDocumentReferenceSerializerAsync.cs
- GenericXmlSecurityToken.cs
- RecommendedAsConfigurableAttribute.cs
- CodeFieldReferenceExpression.cs
- CodeTypeConstructor.cs
- Update.cs
- HttpRequestContext.cs
- SchemaMapping.cs
- PackageRelationshipSelector.cs
- HtmlButton.cs
- CapabilitiesSection.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- HttpCapabilitiesSectionHandler.cs
- PeerNameResolver.cs
- ToolboxItemCollection.cs
- RangeBase.cs
- ObjRef.cs
- ErasingStroke.cs
- ScopedKnownTypes.cs
- ContentValidator.cs