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
- SiteMapNodeItem.cs
- MemberPath.cs
- ArgumentOutOfRangeException.cs
- PerformanceCounterPermissionEntry.cs
- TemplateControlParser.cs
- ExpressionVisitor.cs
- ComPlusTypeLoader.cs
- NameSpaceExtractor.cs
- TypeToken.cs
- COM2Properties.cs
- TabControl.cs
- Tokenizer.cs
- DataServiceRequestArgs.cs
- MobileSysDescriptionAttribute.cs
- ProfilePropertyMetadata.cs
- ElementNotEnabledException.cs
- RedistVersionInfo.cs
- TemplateInstanceAttribute.cs
- ExpressionBuilder.cs
- JulianCalendar.cs
- LoginView.cs
- EventPropertyMap.cs
- Policy.cs
- Compiler.cs
- SchemaConstraints.cs
- BuilderInfo.cs
- NonVisualControlAttribute.cs
- Message.cs
- WebPartUtil.cs
- DefaultBindingPropertyAttribute.cs
- Splitter.cs
- DataGridViewBindingCompleteEventArgs.cs
- LinqDataSourceInsertEventArgs.cs
- CodeArgumentReferenceExpression.cs
- DbParameterHelper.cs
- PreviewControlDesigner.cs
- AttachmentService.cs
- Statements.cs
- ExpressionNormalizer.cs
- Calendar.cs
- TypeDescriptor.cs
- CommandHelpers.cs
- QilChoice.cs
- TextEmbeddedObject.cs
- BrowserCapabilitiesCodeGenerator.cs
- MailWebEventProvider.cs
- VariableQuery.cs
- JsonReaderDelegator.cs
- SchemaInfo.cs
- RijndaelManaged.cs
- EmbeddedMailObjectsCollection.cs
- NameSpaceExtractor.cs
- MSAANativeProvider.cs
- ProfilePropertyNameValidator.cs
- MultiTrigger.cs
- MemberPath.cs
- CmsInterop.cs
- CodeDefaultValueExpression.cs
- PageParser.cs
- OptimalTextSource.cs
- XmlAttributes.cs
- SamlAudienceRestrictionCondition.cs
- ManualResetEventSlim.cs
- XPathAncestorIterator.cs
- Span.cs
- ErrorWrapper.cs
- ButtonAutomationPeer.cs
- WsatTransactionHeader.cs
- Array.cs
- XmlCountingReader.cs
- CodeExpressionStatement.cs
- EventLogEntryCollection.cs
- ApplicationException.cs
- OutputScopeManager.cs
- PrefixQName.cs
- WinEventWrap.cs
- ISFClipboardData.cs
- EntityWrapperFactory.cs
- SecurityElement.cs
- FrameSecurityDescriptor.cs
- WebPartEditVerb.cs
- HtmlTableRow.cs
- EpmContentSerializer.cs
- Set.cs
- ProfileSettings.cs
- SmtpFailedRecipientsException.cs
- Literal.cs
- RunWorkerCompletedEventArgs.cs
- DelegateSerializationHolder.cs
- FlowDocumentReaderAutomationPeer.cs
- WebPartManager.cs
- TileBrush.cs
- TypeConverterHelper.cs
- SecurityHelper.cs
- SmtpReplyReaderFactory.cs
- CodeNamespaceCollection.cs
- MimeXmlReflector.cs
- DecimalKeyFrameCollection.cs
- ListSourceHelper.cs
- SchemaAttDef.cs