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
- HtmlTableRow.cs
- SingleStorage.cs
- UriSection.cs
- PluralizationServiceUtil.cs
- DispatchWrapper.cs
- PermissionSetEnumerator.cs
- WebPartConnectionsEventArgs.cs
- OutputCacheSettingsSection.cs
- DataGridViewCellStyle.cs
- sqlstateclientmanager.cs
- SpecialTypeDataContract.cs
- SmtpException.cs
- WorkflowItemsPresenter.cs
- BitmapDownload.cs
- Attributes.cs
- QueryContinueDragEvent.cs
- UIElement3D.cs
- CheckableControlBaseAdapter.cs
- VisualStyleTypesAndProperties.cs
- TextEndOfSegment.cs
- BuildProviderAppliesToAttribute.cs
- CustomError.cs
- RectangleGeometry.cs
- SelectingProviderEventArgs.cs
- SmiContextFactory.cs
- DbConnectionPoolCounters.cs
- XmlText.cs
- ArrayEditor.cs
- Profiler.cs
- AutomationProperty.cs
- BooleanSwitch.cs
- SqlProvider.cs
- VisemeEventArgs.cs
- IntPtr.cs
- LocationUpdates.cs
- ReceiveSecurityHeaderEntry.cs
- ElementFactory.cs
- SqlHelper.cs
- MinimizableAttributeTypeConverter.cs
- TextElementEnumerator.cs
- SchemaElementDecl.cs
- StylusPlugInCollection.cs
- TimeIntervalCollection.cs
- ZipIOExtraField.cs
- FontSourceCollection.cs
- KnownTypeDataContractResolver.cs
- MatrixConverter.cs
- XmlReaderSettings.cs
- TargetControlTypeCache.cs
- ClientEventManager.cs
- IdnMapping.cs
- TextDecorations.cs
- HeaderedContentControl.cs
- ThreadPool.cs
- ContactManager.cs
- LocalsItemDescription.cs
- RuleSetReference.cs
- BitmapPalette.cs
- TransportReplyChannelAcceptor.cs
- XsltContext.cs
- LogEntryHeaderv1Deserializer.cs
- Number.cs
- BinaryObjectInfo.cs
- InstanceKeyCollisionException.cs
- DesignerView.Commands.cs
- Configuration.cs
- CompressionTransform.cs
- SystemWebSectionGroup.cs
- SafeReadContext.cs
- MaskedTextBoxDesignerActionList.cs
- XmlIgnoreAttribute.cs
- Keyboard.cs
- compensatingcollection.cs
- Literal.cs
- JsonObjectDataContract.cs
- ValidationEventArgs.cs
- BaseCollection.cs
- ResourceWriter.cs
- cache.cs
- Root.cs
- SingleSelectRootGridEntry.cs
- IPHostEntry.cs
- XmlNullResolver.cs
- Underline.cs
- PageAction.cs
- AuthorizationRuleCollection.cs
- AnnotationDocumentPaginator.cs
- VisualStyleElement.cs
- SqlErrorCollection.cs
- FormViewDeletedEventArgs.cs
- SoapSchemaExporter.cs
- InvokePattern.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- HttpHostedTransportConfiguration.cs
- FocusChangedEventArgs.cs
- ConfigurationSettings.cs
- Point3DAnimation.cs
- CreateUserWizardStep.cs
- GroupBox.cs
- XmlToDatasetMap.cs