Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SecurityValidationBehavior.cs
- ActivityStateRecord.cs
- CFStream.cs
- DataAdapter.cs
- WorkflowMarkupSerializerMapping.cs
- WebPartEditVerb.cs
- RouteParametersHelper.cs
- EntityContainerEmitter.cs
- VersionedStreamOwner.cs
- BigInt.cs
- SelectedGridItemChangedEvent.cs
- RoleManagerEventArgs.cs
- BindingSourceDesigner.cs
- CachedTypeface.cs
- ListViewItem.cs
- AsyncResult.cs
- InstanceKeyCompleteException.cs
- ParsedAttributeCollection.cs
- RemoteArgument.cs
- DiscreteKeyFrames.cs
- ProviderConnectionPointCollection.cs
- QueueTransferProtocol.cs
- FamilyMap.cs
- SettingsBase.cs
- ListArgumentProvider.cs
- UpdatePanelTrigger.cs
- PageAdapter.cs
- TextRangeAdaptor.cs
- SqlCacheDependencyDatabaseCollection.cs
- DesignerSerializerAttribute.cs
- PageTheme.cs
- XsltContext.cs
- PersonalizationStateInfoCollection.cs
- MenuItemBinding.cs
- printdlgexmarshaler.cs
- EntityContainerAssociationSetEnd.cs
- XPathDocumentNavigator.cs
- oledbmetadatacollectionnames.cs
- Int32Storage.cs
- AutomationPatternInfo.cs
- StateInitializationDesigner.cs
- FilterQueryOptionExpression.cs
- JournalEntryStack.cs
- LookupBindingPropertiesAttribute.cs
- XmlSchemaAnnotated.cs
- ObjectViewFactory.cs
- ProgressiveCrcCalculatingStream.cs
- QilReplaceVisitor.cs
- CodeDomSerializationProvider.cs
- ImageBrush.cs
- Util.cs
- SafeReversePInvokeHandle.cs
- Quaternion.cs
- CqlIdentifiers.cs
- EventLogPropertySelector.cs
- PersonalizationStateInfo.cs
- CheckBoxStandardAdapter.cs
- ClientTarget.cs
- DeleteCardRequest.cs
- AuthenticationModulesSection.cs
- StatusBarPanel.cs
- PowerModeChangedEventArgs.cs
- InkCanvasSelection.cs
- Descriptor.cs
- configsystem.cs
- SqlErrorCollection.cs
- PageParserFilter.cs
- RegexGroupCollection.cs
- EntityDataSourceDataSelectionPanel.cs
- APCustomTypeDescriptor.cs
- ConsoleKeyInfo.cs
- NullableIntSumAggregationOperator.cs
- XmlDictionaryString.cs
- CharAnimationUsingKeyFrames.cs
- SemaphoreFullException.cs
- LinkClickEvent.cs
- FrameworkObject.cs
- RightsManagementUser.cs
- AsyncPostBackErrorEventArgs.cs
- FileIOPermission.cs
- DataGridViewHitTestInfo.cs
- Error.cs
- OracleString.cs
- WindowsAuthenticationEventArgs.cs
- FreezableOperations.cs
- XmlAnyAttributeAttribute.cs
- EndEvent.cs
- ProxyWebPart.cs
- Hyperlink.cs
- GridViewColumnHeaderAutomationPeer.cs
- DataGridViewCellLinkedList.cs
- basecomparevalidator.cs
- ConfigurationPermission.cs
- HtmlForm.cs
- Floater.cs
- WindowsListViewItemStartMenu.cs
- WindowVisualStateTracker.cs
- DefaultMemberAttribute.cs
- HideDisabledControlAdapter.cs
- FilterException.cs