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
- CodeAssignStatement.cs
- TableHeaderCell.cs
- PowerModeChangedEventArgs.cs
- VirtualDirectoryMapping.cs
- TrackingLocationCollection.cs
- TransactionManagerProxy.cs
- DataSourceXmlTextReader.cs
- ReferentialConstraintRoleElement.cs
- ArgumentOutOfRangeException.cs
- DispatchOperation.cs
- KoreanCalendar.cs
- Codec.cs
- DuplicateWaitObjectException.cs
- FlowDocumentReader.cs
- XmlValueConverter.cs
- ProgressBar.cs
- ClientSideQueueItem.cs
- LedgerEntry.cs
- GraphicsContext.cs
- InkCollectionBehavior.cs
- TemplateControlCodeDomTreeGenerator.cs
- Object.cs
- Processor.cs
- ContentType.cs
- CodeDomConfigurationHandler.cs
- SizeAnimationBase.cs
- XmlSchemaValidationException.cs
- SignatureSummaryDialog.cs
- WebColorConverter.cs
- HtmlInputPassword.cs
- HtmlTableRowCollection.cs
- PropertyCondition.cs
- WindowsIPAddress.cs
- Int64Animation.cs
- PersonalizationProviderCollection.cs
- UniqueTransportManagerRegistration.cs
- TextFormatter.cs
- DelimitedListTraceListener.cs
- GenericTypeParameterBuilder.cs
- WindowsRichEdit.cs
- ExpressionQuoter.cs
- TracePayload.cs
- UdpDiscoveryEndpointElement.cs
- SQLBinaryStorage.cs
- XmlAttributeProperties.cs
- SimplePropertyEntry.cs
- TypeDependencyAttribute.cs
- SafeLibraryHandle.cs
- ConnectionPoolManager.cs
- CommonGetThemePartSize.cs
- IPEndPoint.cs
- StoreAnnotationsMap.cs
- MultiDataTrigger.cs
- SafeCryptoHandles.cs
- TableParagraph.cs
- VisualBasicValue.cs
- Button.cs
- XmlTextReaderImpl.cs
- WebException.cs
- KnownBoxes.cs
- StructuralComparisons.cs
- TextRunProperties.cs
- CFStream.cs
- CanonicalXml.cs
- OptimisticConcurrencyException.cs
- CallbackHandler.cs
- sqlpipe.cs
- DESCryptoServiceProvider.cs
- _WinHttpWebProxyDataBuilder.cs
- MimeReturn.cs
- DesignerVerb.cs
- InputLanguageCollection.cs
- XPathSingletonIterator.cs
- JobDuplex.cs
- OLEDB_Enum.cs
- FrameworkContentElement.cs
- DefaultTextStoreTextComposition.cs
- IDictionary.cs
- EpmHelper.cs
- TraceHwndHost.cs
- WebPartZoneCollection.cs
- ConfigurationProperty.cs
- GroupedContextMenuStrip.cs
- BindingBase.cs
- CorrelationManager.cs
- WorkflowRuntimeElement.cs
- HandlerWithFactory.cs
- EFDataModelProvider.cs
- LocalizableAttribute.cs
- DesignerActionKeyboardBehavior.cs
- OraclePermissionAttribute.cs
- XmlNullResolver.cs
- ModuleElement.cs
- AccessKeyManager.cs
- TagMapInfo.cs
- KeyGesture.cs
- QueryRewriter.cs
- FormsAuthenticationUser.cs
- NullRuntimeConfig.cs
- ModelItemKeyValuePair.cs