Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OdbcReferenceCollection.cs
- SessionSwitchEventArgs.cs
- WebPartConnectionCollection.cs
- SolidBrush.cs
- PrintController.cs
- DataGridViewCellEventArgs.cs
- ParameterToken.cs
- Classification.cs
- thaishape.cs
- WebPartDisplayMode.cs
- PropertyPanel.cs
- NativeCompoundFileAPIs.cs
- OleDbPropertySetGuid.cs
- MenuItem.cs
- NavigationProperty.cs
- KnownColorTable.cs
- FixedSOMTableRow.cs
- RemoteWebConfigurationHost.cs
- PartialCachingControl.cs
- TempFiles.cs
- StateManagedCollection.cs
- ToolStrip.cs
- Interfaces.cs
- LocatorManager.cs
- codemethodreferenceexpression.cs
- RegexRunner.cs
- UInt64Storage.cs
- SoapObjectInfo.cs
- MouseGestureConverter.cs
- Site.cs
- DataKey.cs
- WebPartsSection.cs
- HttpInputStream.cs
- InternalRelationshipCollection.cs
- ContextStaticAttribute.cs
- CloseCryptoHandleRequest.cs
- sortedlist.cs
- TextContainerChangeEventArgs.cs
- CreateUserWizardDesigner.cs
- PagerSettings.cs
- CustomLineCap.cs
- cookiecollection.cs
- HostedTcpTransportManager.cs
- PropertyIDSet.cs
- UnmanagedMarshal.cs
- TypeExtension.cs
- TextEditorTyping.cs
- SEHException.cs
- ExtenderControl.cs
- WebPartCatalogCloseVerb.cs
- TextChange.cs
- CheckoutException.cs
- SqlStream.cs
- AdPostCacheSubstitution.cs
- HMACSHA1.cs
- PassportIdentity.cs
- OpenFileDialog.cs
- TypeDependencyAttribute.cs
- TableAutomationPeer.cs
- Profiler.cs
- EventManager.cs
- Pair.cs
- FunctionMappingTranslator.cs
- DockAndAnchorLayout.cs
- WindowsListViewItem.cs
- FrameDimension.cs
- InstallerTypeAttribute.cs
- HttpModuleCollection.cs
- CacheOutputQuery.cs
- DataReaderContainer.cs
- RecognizerStateChangedEventArgs.cs
- UserMapPath.cs
- BitmapSourceSafeMILHandle.cs
- SqlDataSourceSelectingEventArgs.cs
- DropDownButton.cs
- RectKeyFrameCollection.cs
- LocalBuilder.cs
- OracleTransaction.cs
- DynamicPropertyReader.cs
- DataGridAddNewRow.cs
- SR.cs
- DispatcherObject.cs
- ConcurrentDictionary.cs
- CqlLexerHelpers.cs
- mediaeventargs.cs
- Missing.cs
- BrowserCapabilitiesFactoryBase.cs
- NetworkCredential.cs
- ProviderSettings.cs
- InternalPolicyElement.cs
- ElementProxy.cs
- NullableBoolConverter.cs
- XmlTextReader.cs
- BuildResult.cs
- DesignerSerializerAttribute.cs
- DefaultSection.cs
- ListControl.cs
- safex509handles.cs
- FunctionNode.cs
- DetailsViewDeletedEventArgs.cs