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
- __ComObject.cs
- Int64Storage.cs
- HttpRequest.cs
- DataGridViewButtonColumn.cs
- dataSvcMapFileLoader.cs
- TypedColumnHandler.cs
- Vector3D.cs
- SchemaElementLookUpTableEnumerator.cs
- ExpressionNode.cs
- HybridWebProxyFinder.cs
- TextEditorSelection.cs
- AndCondition.cs
- StorageAssociationSetMapping.cs
- CodeTypeReferenceCollection.cs
- DataGridViewToolTip.cs
- DrawListViewItemEventArgs.cs
- DateTimeConverter.cs
- IPEndPoint.cs
- RandomDelayQueuedSendsAsyncResult.cs
- ServiceHostFactory.cs
- TimeZoneInfo.cs
- SingleSelectRootGridEntry.cs
- CorrelationRequestContext.cs
- CompilerParameters.cs
- DocumentNUp.cs
- XMLSchema.cs
- BufferedStream.cs
- DetailsViewModeEventArgs.cs
- XmlFormatExtensionPrefixAttribute.cs
- InputLangChangeEvent.cs
- ContractMapping.cs
- QilParameter.cs
- DataService.cs
- mactripleDES.cs
- DesignDataSource.cs
- FormViewCommandEventArgs.cs
- TextContainerChangedEventArgs.cs
- MetadataSource.cs
- FormViewDeleteEventArgs.cs
- DesignerAttribute.cs
- PropertyTabChangedEvent.cs
- XmlAtomicValue.cs
- AddressHeaderCollectionElement.cs
- RouteParametersHelper.cs
- FileDialogCustomPlace.cs
- XMLUtil.cs
- WebPartMovingEventArgs.cs
- FloaterParaClient.cs
- OrCondition.cs
- RewritingPass.cs
- EncoderNLS.cs
- MergePropertyDescriptor.cs
- WebPartUtil.cs
- TreeViewDesigner.cs
- PropertyEmitter.cs
- TypeHelper.cs
- WebPartEditorApplyVerb.cs
- CompletedAsyncResult.cs
- NamespaceEmitter.cs
- WmlTextBoxAdapter.cs
- XmlSerializerFaultFormatter.cs
- GridItemProviderWrapper.cs
- ProfileParameter.cs
- CustomTypeDescriptor.cs
- SamlAudienceRestrictionCondition.cs
- DefaultWorkflowSchedulerService.cs
- DaylightTime.cs
- RandomDelayQueuedSendsAsyncResult.cs
- Substitution.cs
- XmlBinaryReader.cs
- MissingFieldException.cs
- BinaryQueryOperator.cs
- GrammarBuilderDictation.cs
- VarRemapper.cs
- DocumentEventArgs.cs
- BitArray.cs
- SqlDataSourceWizardForm.cs
- HttpResponseInternalWrapper.cs
- CorrelationValidator.cs
- Setter.cs
- FontEditor.cs
- ResolveMatchesMessage11.cs
- InProcStateClientManager.cs
- BuildProviderAppliesToAttribute.cs
- TextParagraphCache.cs
- SqlGenericUtil.cs
- Focus.cs
- UndoUnit.cs
- LineBreak.cs
- JavaScriptSerializer.cs
- SafeBitVector32.cs
- TableLayoutRowStyleCollection.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- DtdParser.cs
- KnownTypesHelper.cs
- HttpServerUtilityWrapper.cs
- View.cs
- httpstaticobjectscollection.cs
- EnumerableRowCollectionExtensions.cs
- FixedFlowMap.cs