Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SpellerError.cs
- MeasureItemEvent.cs
- HttpWebRequest.cs
- ScriptComponentDescriptor.cs
- Thread.cs
- MultiSelectRootGridEntry.cs
- HtmlTernaryTree.cs
- CopyNodeSetAction.cs
- ExtentCqlBlock.cs
- Logging.cs
- Condition.cs
- SchemaDeclBase.cs
- ObjectDataSourceStatusEventArgs.cs
- TimeSpanFormat.cs
- TypedTableHandler.cs
- NamedPipeAppDomainProtocolHandler.cs
- XmlSchemaCompilationSettings.cs
- XmlSchemaAttribute.cs
- FrameworkReadOnlyPropertyMetadata.cs
- FlowPosition.cs
- ExclusiveCanonicalizationTransform.cs
- ScrollPattern.cs
- handlecollector.cs
- Byte.cs
- SqlMethodAttribute.cs
- StateDesignerConnector.cs
- AnnotationObservableCollection.cs
- LinkClickEvent.cs
- EventPrivateKey.cs
- DataTableClearEvent.cs
- RunClient.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SQLDouble.cs
- MappableObjectManager.cs
- Operators.cs
- BamlStream.cs
- KnownTypes.cs
- VectorCollectionValueSerializer.cs
- XPathParser.cs
- Frame.cs
- ManifestSignedXml.cs
- NotificationContext.cs
- ObjectQueryProvider.cs
- UnionQueryOperator.cs
- PriorityRange.cs
- DBDataPermissionAttribute.cs
- RadioButton.cs
- ToolStripDesignerAvailabilityAttribute.cs
- Freezable.cs
- ByteRangeDownloader.cs
- ECDiffieHellmanCng.cs
- LineGeometry.cs
- DirectoryLocalQuery.cs
- SecurityRuntime.cs
- CurrencyWrapper.cs
- CssStyleCollection.cs
- ASCIIEncoding.cs
- MetadataItem.cs
- Table.cs
- WebPartTransformer.cs
- ImageConverter.cs
- IIS7WorkerRequest.cs
- OdbcReferenceCollection.cs
- UntrustedRecipientException.cs
- PolicyValidationException.cs
- ActivityDesigner.cs
- BaseResourcesBuildProvider.cs
- CompiledQueryCacheKey.cs
- ADConnectionHelper.cs
- StatusBarPanelClickEvent.cs
- Adorner.cs
- DetailsViewInsertEventArgs.cs
- SafeNativeMethods.cs
- ComplexType.cs
- PerformanceCounterLib.cs
- CodeTypeParameter.cs
- PageContent.cs
- TranslateTransform.cs
- SafeRightsManagementSessionHandle.cs
- SymLanguageVendor.cs
- HitTestDrawingContextWalker.cs
- Misc.cs
- RepeaterItemCollection.cs
- NoneExcludedImageIndexConverter.cs
- DigestTraceRecordHelper.cs
- DataPagerFieldCollection.cs
- HtmlMeta.cs
- CompositeScriptReference.cs
- RolePrincipal.cs
- _HelperAsyncResults.cs
- AssemblyBuilder.cs
- RelationshipEndMember.cs
- Axis.cs
- BinaryParser.cs
- TableLayoutCellPaintEventArgs.cs
- RuleRef.cs
- IndentedWriter.cs
- CodePageUtils.cs
- Group.cs
- FamilyMapCollection.cs