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
- SemanticResolver.cs
- XPathQueryGenerator.cs
- TrayIconDesigner.cs
- DataTemplateKey.cs
- PriorityChain.cs
- IPAddressCollection.cs
- EmbeddedMailObject.cs
- ComponentSerializationService.cs
- DispatcherHooks.cs
- MessageBuffer.cs
- BitArray.cs
- PointCollectionConverter.cs
- DrawingCollection.cs
- ClientData.cs
- MatrixCamera.cs
- ResXBuildProvider.cs
- ObjectStateFormatter.cs
- CreateUserWizardDesigner.cs
- WithParamAction.cs
- ContextStack.cs
- CompensatableTransactionScopeActivity.cs
- ConstructorArgumentAttribute.cs
- HtmlTextArea.cs
- SizeLimitedCache.cs
- PerformanceCounterCategory.cs
- EntityConnectionStringBuilder.cs
- XmlNamespaceDeclarationsAttribute.cs
- Int16Converter.cs
- IsolatedStorageFileStream.cs
- DeclarativeCatalogPartDesigner.cs
- SqlMultiplexer.cs
- SqlUnionizer.cs
- CheckBoxFlatAdapter.cs
- SafeThemeHandle.cs
- GreenMethods.cs
- UiaCoreTypesApi.cs
- LinearGradientBrush.cs
- ApplicationManager.cs
- MsmqInputMessagePool.cs
- DriveInfo.cs
- XmlValidatingReader.cs
- ChannelServices.cs
- OleDbConnection.cs
- ServiceBuildProvider.cs
- FixedDocumentPaginator.cs
- TransactionManager.cs
- FontDriver.cs
- ETagAttribute.cs
- ObjectDataSourceEventArgs.cs
- RbTree.cs
- BindingNavigator.cs
- HiddenField.cs
- OdbcConnectionString.cs
- CodeDOMProvider.cs
- XmlCDATASection.cs
- XmlSchemaParticle.cs
- DefaultSerializationProviderAttribute.cs
- InteropTrackingRecord.cs
- ComponentCodeDomSerializer.cs
- Vector3DKeyFrameCollection.cs
- CommentAction.cs
- Trace.cs
- LineSegment.cs
- HttpListenerElement.cs
- ToolStripDropDownItem.cs
- ScrollItemPattern.cs
- XsdCachingReader.cs
- BooleanSwitch.cs
- HtmlWindow.cs
- WSFederationHttpBindingElement.cs
- precedingquery.cs
- ClientSettingsStore.cs
- BooleanConverter.cs
- RenderDataDrawingContext.cs
- controlskin.cs
- WmlPanelAdapter.cs
- SemanticResultKey.cs
- WebServiceClientProxyGenerator.cs
- SqlFlattener.cs
- ObjectListCommand.cs
- CompilationUnit.cs
- StrokeNodeEnumerator.cs
- SystemTcpStatistics.cs
- AccessibleObject.cs
- TextContainerHelper.cs
- SiteOfOriginContainer.cs
- HtmlImage.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- FirstMatchCodeGroup.cs
- UIElement.cs
- LinqDataSourceDisposeEventArgs.cs
- Site.cs
- StateItem.cs
- EnumUnknown.cs
- MembershipSection.cs
- BinaryReader.cs
- ProjectionPathBuilder.cs
- RelatedImageListAttribute.cs
- ResourceProperty.cs
- PrivilegedConfigurationManager.cs