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
- Mappings.cs
- Privilege.cs
- FrameworkReadOnlyPropertyMetadata.cs
- CheckedListBox.cs
- HostVisual.cs
- XmlSchemaObject.cs
- WeakHashtable.cs
- DerivedKeySecurityTokenStub.cs
- EdmFunction.cs
- QueryResult.cs
- LineUtil.cs
- ClientData.cs
- HashHelpers.cs
- PropertyTabChangedEvent.cs
- ToolStripHighContrastRenderer.cs
- LabelEditEvent.cs
- ZoneIdentityPermission.cs
- InvalidCastException.cs
- VersionedStreamOwner.cs
- QilLiteral.cs
- BaseCollection.cs
- PartialTrustVisibleAssemblyCollection.cs
- QuaternionRotation3D.cs
- ASCIIEncoding.cs
- TraceUtility.cs
- WeakReferenceEnumerator.cs
- Image.cs
- SynchronizationFilter.cs
- HMACSHA384.cs
- IntSumAggregationOperator.cs
- ThemeDictionaryExtension.cs
- PhoneCallDesigner.cs
- RuleInfoComparer.cs
- PageClientProxyGenerator.cs
- CompilerGlobalScopeAttribute.cs
- SequentialUshortCollection.cs
- ConfigXmlAttribute.cs
- CalendarKeyboardHelper.cs
- ListBase.cs
- LeftCellWrapper.cs
- Span.cs
- TabControlToolboxItem.cs
- ADRoleFactory.cs
- ImportContext.cs
- ProfileEventArgs.cs
- StorageFunctionMapping.cs
- HashMembershipCondition.cs
- CacheMode.cs
- DataServiceQueryException.cs
- NgenServicingAttributes.cs
- ReadWriteObjectLock.cs
- DefaultValidator.cs
- RegexParser.cs
- StagingAreaInputItem.cs
- TypeUnloadedException.cs
- Point3DCollection.cs
- UrlRoutingHandler.cs
- AdornerPresentationContext.cs
- VoiceInfo.cs
- XmlElement.cs
- AssemblyUtil.cs
- FactoryGenerator.cs
- CookieParameter.cs
- ProgressBar.cs
- TreeViewHitTestInfo.cs
- TargetInvocationException.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ToolstripProfessionalRenderer.cs
- DocumentViewerAutomationPeer.cs
- HttpRequest.cs
- OneWayElement.cs
- RSAPKCS1SignatureDeformatter.cs
- ContentAlignmentEditor.cs
- SqlMethodTransformer.cs
- GACMembershipCondition.cs
- CssTextWriter.cs
- Evaluator.cs
- EntityDataSourceWrapper.cs
- DataTablePropertyDescriptor.cs
- Pens.cs
- DependencyObject.cs
- XmlSchemaInfo.cs
- LicenseProviderAttribute.cs
- DetailsViewInsertEventArgs.cs
- TabControlDesigner.cs
- ChangeInterceptorAttribute.cs
- NullableBoolConverter.cs
- Predicate.cs
- UpdateCompiler.cs
- Symbol.cs
- KeyTimeConverter.cs
- TextSelectionProcessor.cs
- IIS7WorkerRequest.cs
- XmlJsonWriter.cs
- ProcessHostMapPath.cs
- connectionpool.cs
- PopOutPanel.cs
- XmlSerializationReader.cs
- GreaterThanOrEqual.cs
- ProxyHwnd.cs