Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / WebBaseEventKeyComparer.cs / 1305376 / 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
- CodeArgumentReferenceExpression.cs
- FixedDocumentSequencePaginator.cs
- DeadCharTextComposition.cs
- DSACryptoServiceProvider.cs
- ProbeRequestResponseAsyncResult.cs
- EntityKey.cs
- DataBindingCollection.cs
- ItemContainerProviderWrapper.cs
- Geometry.cs
- ProjectionAnalyzer.cs
- TableRowGroup.cs
- AssemblyCollection.cs
- DbConnectionPoolIdentity.cs
- PageThemeParser.cs
- MinMaxParagraphWidth.cs
- AsnEncodedData.cs
- MimeParameterWriter.cs
- SmiGettersStream.cs
- CollectionViewSource.cs
- GestureRecognitionResult.cs
- FontUnit.cs
- WarningException.cs
- CharacterMetricsDictionary.cs
- ResourceDescriptionAttribute.cs
- WebZone.cs
- UnorderedHashRepartitionStream.cs
- HMACRIPEMD160.cs
- DataViewManagerListItemTypeDescriptor.cs
- XPathBuilder.cs
- CacheSection.cs
- ValidationEventArgs.cs
- _HTTPDateParse.cs
- SqlCaseSimplifier.cs
- CounterSampleCalculator.cs
- WebCategoryAttribute.cs
- PreservationFileReader.cs
- InvokeFunc.cs
- CheckableControlBaseAdapter.cs
- DataPagerField.cs
- WebPartTracker.cs
- UiaCoreTypesApi.cs
- Site.cs
- HistoryEventArgs.cs
- FontFamilyConverter.cs
- ConstructorBuilder.cs
- Addressing.cs
- COM2IPerPropertyBrowsingHandler.cs
- RelationshipEndMember.cs
- ScriptingJsonSerializationSection.cs
- MemberDescriptor.cs
- _DisconnectOverlappedAsyncResult.cs
- ClientBuildManager.cs
- PersonalizationProviderCollection.cs
- XPathBinder.cs
- BitmapScalingModeValidation.cs
- PagedDataSource.cs
- XmlNodeList.cs
- ValuePattern.cs
- MissingSatelliteAssemblyException.cs
- ClientConfigPaths.cs
- JoinQueryOperator.cs
- TextEditorContextMenu.cs
- CursorConverter.cs
- SoapSchemaImporter.cs
- CacheVirtualItemsEvent.cs
- VectorAnimationUsingKeyFrames.cs
- TextCompositionManager.cs
- ISFClipboardData.cs
- PropertyMapper.cs
- WorkflowServiceBehavior.cs
- DbProviderServices.cs
- TimeZone.cs
- VerificationAttribute.cs
- SmiEventSink_DeferedProcessing.cs
- BinHexEncoding.cs
- CompiledRegexRunner.cs
- PromptBuilder.cs
- RelationshipSet.cs
- SessionStateSection.cs
- SystemWebSectionGroup.cs
- WhitespaceReader.cs
- SqlConnectionHelper.cs
- WpfKnownMember.cs
- PassportAuthenticationModule.cs
- SQLChars.cs
- DataSourceControl.cs
- DecodeHelper.cs
- CookieProtection.cs
- UdpTransportSettingsElement.cs
- XD.cs
- MaxMessageSizeStream.cs
- WebPartAuthorizationEventArgs.cs
- CalendarAutoFormat.cs
- mactripleDES.cs
- ILGen.cs
- BitmapMetadataEnumerator.cs
- HttpCacheVaryByContentEncodings.cs
- Utility.cs
- BooleanAnimationBase.cs
- FirewallWrapper.cs