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
- PointF.cs
- validation.cs
- ThreadStateException.cs
- XmlSignatureProperties.cs
- DataTable.cs
- SignedXmlDebugLog.cs
- DocumentSchemaValidator.cs
- ProjectionCamera.cs
- PropertyGridView.cs
- DateTimeOffsetAdapter.cs
- AnchoredBlock.cs
- SqlTypesSchemaImporter.cs
- ipaddressinformationcollection.cs
- ProcessHost.cs
- WebCategoryAttribute.cs
- HostProtectionPermission.cs
- Configuration.cs
- SelectedGridItemChangedEvent.cs
- LicenseException.cs
- DateTimeConverter.cs
- XmlWriterSettings.cs
- DesignerValidatorAdapter.cs
- XmlNamespaceDeclarationsAttribute.cs
- StringAnimationUsingKeyFrames.cs
- NullRuntimeConfig.cs
- MenuItem.cs
- Publisher.cs
- ContentDisposition.cs
- GACMembershipCondition.cs
- HostedElements.cs
- sqlpipe.cs
- ArrayConverter.cs
- SeverityFilter.cs
- Debug.cs
- EntityDataSourceChangedEventArgs.cs
- FileDialogCustomPlace.cs
- DoubleAnimationClockResource.cs
- SBCSCodePageEncoding.cs
- HtmlToClrEventProxy.cs
- AnyAllSearchOperator.cs
- RichTextBoxConstants.cs
- recordstate.cs
- AmbiguousMatchException.cs
- PrimaryKeyTypeConverter.cs
- PrincipalPermission.cs
- DiagnosticTrace.cs
- LogWriteRestartAreaState.cs
- IdentityReference.cs
- IdentityNotMappedException.cs
- JpegBitmapDecoder.cs
- mongolianshape.cs
- CopyOnWriteList.cs
- TextStore.cs
- CustomAttributeFormatException.cs
- ExtendedPropertyDescriptor.cs
- BypassElement.cs
- GenericAuthenticationEventArgs.cs
- ipaddressinformationcollection.cs
- Atom10FormatterFactory.cs
- TableChangeProcessor.cs
- ImageListStreamer.cs
- OneWayChannelFactory.cs
- DataStreamFromComStream.cs
- ExpressionPrefixAttribute.cs
- PartialCachingAttribute.cs
- HtmlControl.cs
- ValuePatternIdentifiers.cs
- FixUpCollection.cs
- UIElementHelper.cs
- ProcessingInstructionAction.cs
- OracleParameterBinding.cs
- MenuEventArgs.cs
- ObjectDataSourceStatusEventArgs.cs
- XmlSchemaValidator.cs
- ScriptingJsonSerializationSection.cs
- ThemeDirectoryCompiler.cs
- MarkerProperties.cs
- SQLByteStorage.cs
- Perspective.cs
- BordersPage.cs
- ProfileSection.cs
- TreeViewAutomationPeer.cs
- CompositeTypefaceMetrics.cs
- WebPartCancelEventArgs.cs
- CompareInfo.cs
- FontCollection.cs
- RC2.cs
- NativeRecognizer.cs
- ThreadInterruptedException.cs
- StyleBamlTreeBuilder.cs
- NamedElement.cs
- FormsAuthenticationUser.cs
- ButtonStandardAdapter.cs
- WebPartDeleteVerb.cs
- DataTablePropertyDescriptor.cs
- _ConnectStream.cs
- DeflateInput.cs
- SymbolEqualComparer.cs
- ConfigurationLoader.cs
- SHA1Managed.cs