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
- FilteredXmlReader.cs
- RotationValidation.cs
- ViewGenResults.cs
- FrugalMap.cs
- DockPanel.cs
- RootProfilePropertySettingsCollection.cs
- ReferenceEqualityComparer.cs
- BindingCollection.cs
- BitmapCodecInfoInternal.cs
- TablePattern.cs
- SamlAdvice.cs
- Pair.cs
- MethodExpr.cs
- WsdlImporterElement.cs
- DesignerExtenders.cs
- COM2IPerPropertyBrowsingHandler.cs
- ImageResources.Designer.cs
- HtmlTable.cs
- LeaseManager.cs
- SafeThreadHandle.cs
- SqlVisitor.cs
- EntitySetDataBindingList.cs
- EntityDataSourceContextCreatingEventArgs.cs
- MailDefinition.cs
- prefixendpointaddressmessagefiltertable.cs
- OpenTypeMethods.cs
- LinkArea.cs
- graph.cs
- Site.cs
- AccessedThroughPropertyAttribute.cs
- DataGridViewComboBoxCell.cs
- X509Certificate2Collection.cs
- Opcode.cs
- BrowserDefinitionCollection.cs
- TemplateInstanceAttribute.cs
- SchemaSetCompiler.cs
- Condition.cs
- ChangeDirector.cs
- JsonObjectDataContract.cs
- PhysicalAddress.cs
- EndpointIdentityExtension.cs
- SmiEventSink_DeferedProcessing.cs
- MemberRestriction.cs
- TransactionWaitAsyncResult.cs
- ClientTargetCollection.cs
- Ray3DHitTestResult.cs
- Double.cs
- CmsUtils.cs
- ExecutionEngineException.cs
- Literal.cs
- SafeNativeMethods.cs
- CustomErrorsSection.cs
- CaseCqlBlock.cs
- StreamInfo.cs
- TextEditorCharacters.cs
- AffineTransform3D.cs
- KnownAssembliesSet.cs
- EntityDataSourceState.cs
- TextEffectCollection.cs
- DurableInstanceProvider.cs
- SystemColors.cs
- CapabilitiesUse.cs
- BackStopAuthenticationModule.cs
- DES.cs
- BrowsableAttribute.cs
- BamlLocalizableResourceKey.cs
- ObjectHandle.cs
- PropVariant.cs
- Byte.cs
- TabletDevice.cs
- HttpBrowserCapabilitiesWrapper.cs
- ObsoleteAttribute.cs
- SqlRewriteScalarSubqueries.cs
- DbParameterHelper.cs
- IDQuery.cs
- _IPv6Address.cs
- ListenerUnsafeNativeMethods.cs
- DesignerLoader.cs
- SqlFlattener.cs
- Currency.cs
- ComponentDispatcherThread.cs
- DataGridCommandEventArgs.cs
- ProfileSection.cs
- ToolStripSystemRenderer.cs
- BufferedGraphicsContext.cs
- ImpersonateTokenRef.cs
- Glyph.cs
- TextElementAutomationPeer.cs
- DesignerCategoryAttribute.cs
- NetworkCredential.cs
- TypeBrowser.xaml.cs
- ObjectStateEntry.cs
- FunctionDescription.cs
- XmlElementElementCollection.cs
- HttpConfigurationContext.cs
- BigInt.cs
- OleDbTransaction.cs
- _ContextAwareResult.cs
- BooleanExpr.cs
- Resources.Designer.cs