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
- Assembly.cs
- CollectionContainer.cs
- SystemIPInterfaceProperties.cs
- SynchronizingStream.cs
- GrabHandleGlyph.cs
- XDeferredAxisSource.cs
- ConfigurationSettings.cs
- LocationReference.cs
- MenuItem.cs
- TogglePattern.cs
- XmlILModule.cs
- ConnectionsZone.cs
- RelationshipEndCollection.cs
- BinaryMethodMessage.cs
- _Events.cs
- PagerSettings.cs
- RuntimeWrappedException.cs
- NativeMsmqMessage.cs
- SinglePageViewer.cs
- WebPartsPersonalizationAuthorization.cs
- Underline.cs
- FilteredXmlReader.cs
- TraceLog.cs
- HttpModuleActionCollection.cs
- ListQueryResults.cs
- DetailsViewUpdateEventArgs.cs
- Parallel.cs
- SamlSubject.cs
- MimeFormImporter.cs
- CreateUserWizardAutoFormat.cs
- FlowLayoutPanel.cs
- storepermission.cs
- OdbcStatementHandle.cs
- NoResizeHandleGlyph.cs
- DefaultTypeArgumentAttribute.cs
- TrackingMemoryStream.cs
- ValueCollectionParameterReader.cs
- LexicalChunk.cs
- KeyInterop.cs
- AVElementHelper.cs
- MaterialCollection.cs
- AddInActivator.cs
- DbExpressionBuilder.cs
- cookiecontainer.cs
- Cursors.cs
- OciEnlistContext.cs
- SpotLight.cs
- RuntimeDelegateArgument.cs
- ProgressChangedEventArgs.cs
- documentsequencetextview.cs
- PreloadedPackages.cs
- WindowsUserNameCachingSecurityTokenAuthenticator.cs
- StaticExtension.cs
- GrammarBuilderPhrase.cs
- Registry.cs
- NamedPipeDuplicateContext.cs
- BoolExpressionVisitors.cs
- XmlEntity.cs
- TextViewSelectionProcessor.cs
- X509SecurityTokenProvider.cs
- DiscoveryRequestHandler.cs
- CodeConstructor.cs
- Clause.cs
- ConnectionStringSettings.cs
- RealizationContext.cs
- SchemaMapping.cs
- WinCategoryAttribute.cs
- TabPanel.cs
- DataGridViewImageCell.cs
- OleDbError.cs
- Calendar.cs
- RequestCacheEntry.cs
- WebServiceHandler.cs
- SpellerStatusTable.cs
- SafeNativeMethods.cs
- IsolatedStoragePermission.cs
- OleDbCommand.cs
- SingleQueryOperator.cs
- ClickablePoint.cs
- ResXResourceReader.cs
- AggregateNode.cs
- XmlEnumAttribute.cs
- WebPartsPersonalization.cs
- LostFocusEventManager.cs
- SystemWebExtensionsSectionGroup.cs
- StrongName.cs
- HtmlTableRow.cs
- DbDataReader.cs
- HwndHostAutomationPeer.cs
- CodeActivity.cs
- SafeEventLogWriteHandle.cs
- UnhandledExceptionEventArgs.cs
- GatewayDefinition.cs
- SchemaSetCompiler.cs
- TypeLoadException.cs
- FieldMetadata.cs
- PersonalizationEntry.cs
- MessageFault.cs
- AlternateViewCollection.cs
- ValidatorCollection.cs