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
- EnumValidator.cs
- Repeater.cs
- RandomNumberGenerator.cs
- CompilerTypeWithParams.cs
- GroupBox.cs
- ListViewItem.cs
- SynchronizedDispatch.cs
- AnimationStorage.cs
- CapabilitiesPattern.cs
- MenuEventArgs.cs
- ping.cs
- SafeEventHandle.cs
- TableStyle.cs
- NetCodeGroup.cs
- XmlStrings.cs
- AsyncContentLoadedEventArgs.cs
- NullExtension.cs
- WhereaboutsReader.cs
- X509RawDataKeyIdentifierClause.cs
- GC.cs
- WmiInstallComponent.cs
- SweepDirectionValidation.cs
- WsdlBuildProvider.cs
- PrivateFontCollection.cs
- NativeRightsManagementAPIsStructures.cs
- StrongNameKeyPair.cs
- DrawListViewItemEventArgs.cs
- QueryResponse.cs
- DbSourceCommand.cs
- CryptoHandle.cs
- DBDataPermissionAttribute.cs
- DiscoveryExceptionDictionary.cs
- HtmlSelect.cs
- DBConcurrencyException.cs
- HttpConfigurationContext.cs
- DataTableReaderListener.cs
- HyperLink.cs
- HtmlInputText.cs
- PtsHelper.cs
- InternalSafeNativeMethods.cs
- AlternateView.cs
- ClockGroup.cs
- DocumentPageViewAutomationPeer.cs
- CodeDomConfigurationHandler.cs
- ProtectedConfigurationProviderCollection.cs
- ValidatedControlConverter.cs
- InternalConfigHost.cs
- ControlAdapter.cs
- DoubleStorage.cs
- XmlSchemaCollection.cs
- CaseExpr.cs
- BindingOperations.cs
- IPEndPointCollection.cs
- IsolationInterop.cs
- SafeNativeMethods.cs
- PointIndependentAnimationStorage.cs
- NamedPipeHostedTransportConfiguration.cs
- SoapExtensionTypeElement.cs
- StaticExtensionConverter.cs
- AttachedAnnotationChangedEventArgs.cs
- SQLString.cs
- XmlSchemaAttribute.cs
- RC2CryptoServiceProvider.cs
- WebServiceClientProxyGenerator.cs
- _IPv6Address.cs
- SqlDataSourceCustomCommandEditor.cs
- WindowsAuthenticationModule.cs
- SizeFConverter.cs
- ColorTranslator.cs
- CFGGrammar.cs
- StreamReader.cs
- WebSysDescriptionAttribute.cs
- RangeBaseAutomationPeer.cs
- TranslateTransform.cs
- GlobalAllocSafeHandle.cs
- ProfileSettingsCollection.cs
- NamedPipeDuplicateContext.cs
- Regex.cs
- Environment.cs
- FixedNode.cs
- WinEventWrap.cs
- QilStrConcatenator.cs
- PngBitmapEncoder.cs
- GridPattern.cs
- TreeNodeConverter.cs
- TypeKeyValue.cs
- SingleAnimationBase.cs
- EntityContainer.cs
- DownloadProgressEventArgs.cs
- TabControlEvent.cs
- Parser.cs
- CellTreeNodeVisitors.cs
- ByteStreamGeometryContext.cs
- ReferentialConstraint.cs
- TaiwanLunisolarCalendar.cs
- ImageSource.cs
- AppDomainShutdownMonitor.cs
- RawStylusInputCustomData.cs
- DeviceFilterDictionary.cs
- DoubleLinkListEnumerator.cs