Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SafeHandle.cs
- WebConfigManager.cs
- XmlProcessingInstruction.cs
- typedescriptorpermission.cs
- SpecularMaterial.cs
- RelatedEnd.cs
- TextDecorationCollection.cs
- WindowsFormsSynchronizationContext.cs
- DeclarativeCatalogPart.cs
- ModifierKeysConverter.cs
- Function.cs
- UserControlBuildProvider.cs
- ScriptReference.cs
- Match.cs
- InteropBitmapSource.cs
- EndOfStreamException.cs
- StylusPlugin.cs
- RegexRunnerFactory.cs
- DataTableClearEvent.cs
- DragDeltaEventArgs.cs
- OperandQuery.cs
- TimeIntervalCollection.cs
- XmlQueryType.cs
- RequestQueue.cs
- DoubleKeyFrameCollection.cs
- SR.Designer.cs
- ComboBoxItem.cs
- AuthenticationModuleElement.cs
- URLEditor.cs
- LassoSelectionBehavior.cs
- ToolStripPanelRenderEventArgs.cs
- MaterialGroup.cs
- ParameterToken.cs
- ClientRoleProvider.cs
- ButtonFieldBase.cs
- InvalidDataContractException.cs
- MappedMetaModel.cs
- GridView.cs
- SQLMoneyStorage.cs
- ApplicationManager.cs
- BufferModesCollection.cs
- BooleanExpr.cs
- EdmRelationshipRoleAttribute.cs
- DataGridrowEditEndingEventArgs.cs
- AutoGeneratedFieldProperties.cs
- CompareValidator.cs
- HandlerElement.cs
- SmtpSection.cs
- ExpressionPrefixAttribute.cs
- StrokeNodeOperations2.cs
- MarshalByValueComponent.cs
- WindowsClaimSet.cs
- QuadTree.cs
- InteropBitmapSource.cs
- SocketElement.cs
- EntityDataSourceChangedEventArgs.cs
- SapiRecoInterop.cs
- RenderDataDrawingContext.cs
- DrawListViewSubItemEventArgs.cs
- DataPagerCommandEventArgs.cs
- AbstractDataSvcMapFileLoader.cs
- PrivilegeNotHeldException.cs
- HttpWebRequest.cs
- BorderSidesEditor.cs
- GPRECT.cs
- MsmqIntegrationBindingElement.cs
- ClientUrlResolverWrapper.cs
- XmlSignificantWhitespace.cs
- WeakReferenceEnumerator.cs
- GridLengthConverter.cs
- SafeHandles.cs
- BitmapImage.cs
- ConnectionConsumerAttribute.cs
- WrappedReader.cs
- FloaterBaseParagraph.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- TimeSpanMinutesConverter.cs
- MonthCalendarDesigner.cs
- RepeaterItemEventArgs.cs
- HwndAppCommandInputProvider.cs
- WebScriptMetadataFormatter.cs
- XmlUtil.cs
- ApplicationDirectoryMembershipCondition.cs
- AddInSegmentDirectoryNotFoundException.cs
- BindToObject.cs
- ColorConvertedBitmap.cs
- SimpleHandlerBuildProvider.cs
- WindowsProgressbar.cs
- AssociationSet.cs
- GroupQuery.cs
- xmlglyphRunInfo.cs
- ViewSimplifier.cs
- SubMenuStyleCollection.cs
- DiscriminatorMap.cs
- DataGridViewComboBoxCell.cs
- SqlBinder.cs
- ScrollBar.cs
- SplitterPanel.cs
- WinInetCache.cs
- ToolStripArrowRenderEventArgs.cs