Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / WebBaseEventKeyComparer.cs / 1305376 / 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
- CssTextWriter.cs
- InstanceDescriptor.cs
- MultilineStringEditor.cs
- ObjectCache.cs
- ControlPropertyNameConverter.cs
- tooltip.cs
- DispatcherTimer.cs
- AssertValidation.cs
- ResourceReader.cs
- MSAAEventDispatcher.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- MeasurementDCInfo.cs
- GatewayIPAddressInformationCollection.cs
- IntranetCredentialPolicy.cs
- BitmapEffectGroup.cs
- FormViewPageEventArgs.cs
- SqlRewriteScalarSubqueries.cs
- TextEditorDragDrop.cs
- _Rfc2616CacheValidators.cs
- GridViewColumn.cs
- InfocardChannelParameter.cs
- RtfFormatStack.cs
- EdmToObjectNamespaceMap.cs
- SqlBuilder.cs
- Label.cs
- SmtpAuthenticationManager.cs
- SqlDataRecord.cs
- TableRowCollection.cs
- LookupBindingPropertiesAttribute.cs
- PackageDigitalSignatureManager.cs
- FileLevelControlBuilderAttribute.cs
- EndpointNotFoundException.cs
- Int64.cs
- EventSinkActivityDesigner.cs
- ThemeDirectoryCompiler.cs
- WCFBuildProvider.cs
- DBAsyncResult.cs
- GenericTypeParameterBuilder.cs
- MaterialGroup.cs
- UnsafeNativeMethods.cs
- CompilerLocalReference.cs
- ConsoleCancelEventArgs.cs
- JavaScriptString.cs
- FontCacheUtil.cs
- ProcessMonitor.cs
- TextSearch.cs
- TcpAppDomainProtocolHandler.cs
- EdmComplexTypeAttribute.cs
- M3DUtil.cs
- OleDbTransaction.cs
- Expressions.cs
- NativeRecognizer.cs
- GeneralTransform2DTo3DTo2D.cs
- MDIControlStrip.cs
- BeginEvent.cs
- TextEffect.cs
- RenderCapability.cs
- SqlBulkCopyColumnMappingCollection.cs
- SoapElementAttribute.cs
- RoleProviderPrincipal.cs
- TableDesigner.cs
- FunctionMappingTranslator.cs
- DataTableMapping.cs
- CorrelationValidator.cs
- CalendarDateRange.cs
- TargetInvocationException.cs
- TextProperties.cs
- IItemContainerGenerator.cs
- InstanceData.cs
- StrokeIntersection.cs
- WorkflowMessageEventArgs.cs
- DragEventArgs.cs
- CreateInstanceBinder.cs
- EntityKeyElement.cs
- SystemUdpStatistics.cs
- Constant.cs
- SymbolUsageManager.cs
- AssociationSetEnd.cs
- CdpEqualityComparer.cs
- ValidationUtility.cs
- CharacterBuffer.cs
- TheQuery.cs
- LayoutEngine.cs
- FocusChangedEventArgs.cs
- WriteableBitmap.cs
- DiscriminatorMap.cs
- ParentQuery.cs
- NameTable.cs
- PngBitmapDecoder.cs
- EmptyReadOnlyDictionaryInternal.cs
- DesignerToolboxInfo.cs
- XmlILStorageConverter.cs
- RequestSecurityTokenResponseCollection.cs
- DataRowExtensions.cs
- SortFieldComparer.cs
- Pen.cs
- SoapReflectionImporter.cs
- FormViewDesigner.cs
- EntityProxyFactory.cs
- PrintEvent.cs