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
- RefType.cs
- WebPartZoneBase.cs
- ButtonFieldBase.cs
- ListViewSelectEventArgs.cs
- DataBindingCollection.cs
- MaterialGroup.cs
- ConfigurationStrings.cs
- SolidColorBrush.cs
- OdbcConnectionHandle.cs
- FixUp.cs
- ToolStripSeparator.cs
- CustomAttributeSerializer.cs
- UnmanagedMemoryAccessor.cs
- JournalNavigationScope.cs
- OrCondition.cs
- MultipleViewProviderWrapper.cs
- ScaleTransform.cs
- ErrorWrapper.cs
- TypedDataSourceCodeGenerator.cs
- XmlTypeAttribute.cs
- DelegateBodyWriter.cs
- GenericTypeParameterBuilder.cs
- KerberosTicketHashIdentifierClause.cs
- TdsEnums.cs
- ButtonAutomationPeer.cs
- NameTable.cs
- XmlDictionaryReaderQuotas.cs
- ScrollChrome.cs
- SafeRightsManagementPubHandle.cs
- SqlServices.cs
- DragEventArgs.cs
- URLBuilder.cs
- EntityReference.cs
- PropertyTabAttribute.cs
- MenuItemBinding.cs
- EmptyReadOnlyDictionaryInternal.cs
- ProtocolsSection.cs
- SchemaImporterExtensionElementCollection.cs
- ElementHostAutomationPeer.cs
- Mapping.cs
- TableLayoutRowStyleCollection.cs
- ConnectivityStatus.cs
- iisPickupDirectory.cs
- NonParentingControl.cs
- XmlSchemaComplexType.cs
- VerificationException.cs
- FontStyles.cs
- DataListComponentEditor.cs
- SBCSCodePageEncoding.cs
- CalendarButtonAutomationPeer.cs
- ClientBuildManager.cs
- OSFeature.cs
- PtsContext.cs
- SqlDependency.cs
- HandlerMappingMemo.cs
- SizeAnimationUsingKeyFrames.cs
- ObjectDataSourceEventArgs.cs
- DesignerMetadata.cs
- EntitySqlQueryState.cs
- EditingCoordinator.cs
- XmlILOptimizerVisitor.cs
- tooltip.cs
- WindowsGraphicsCacheManager.cs
- GrammarBuilderPhrase.cs
- SafeCoTaskMem.cs
- SourceFileInfo.cs
- TemplateKey.cs
- CheckBox.cs
- FontResourceCache.cs
- ChangeTracker.cs
- CatalogZone.cs
- TablePatternIdentifiers.cs
- GradientSpreadMethodValidation.cs
- ShapeTypeface.cs
- RouteValueDictionary.cs
- ListView.cs
- RemotingSurrogateSelector.cs
- MatrixTransform3D.cs
- InlineCollection.cs
- SqlAliasesReferenced.cs
- RayHitTestParameters.cs
- Set.cs
- SmiMetaDataProperty.cs
- MetadataPropertyCollection.cs
- ListViewUpdatedEventArgs.cs
- KeyboardNavigation.cs
- SchemaCompiler.cs
- WebReferencesBuildProvider.cs
- CodePropertyReferenceExpression.cs
- ModelFactory.cs
- COSERVERINFO.cs
- WindowsSysHeader.cs
- GeneratedCodeAttribute.cs
- WindowsScroll.cs
- WebPartHelpVerb.cs
- JoinGraph.cs
- X509Chain.cs
- ParameterRetriever.cs
- CFStream.cs
- FieldDescriptor.cs