Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- XmlSortKey.cs
- SqlVersion.cs
- ServiceDocument.cs
- WebPartDescriptionCollection.cs
- UnsafeCollabNativeMethods.cs
- DataObject.cs
- KeyConstraint.cs
- CultureTableRecord.cs
- WebScriptServiceHost.cs
- TableLayoutStyleCollection.cs
- FormViewCommandEventArgs.cs
- ScalarType.cs
- Matrix3DStack.cs
- ResourcesBuildProvider.cs
- QuaternionRotation3D.cs
- StrokeFIndices.cs
- TextRangeSerialization.cs
- PointAnimationUsingPath.cs
- dtdvalidator.cs
- XMLUtil.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SqlColumnizer.cs
- DataGridViewColumnCollection.cs
- MissingMemberException.cs
- TraceLevelStore.cs
- DisplayInformation.cs
- QueryableDataSourceView.cs
- LogConverter.cs
- WindowPattern.cs
- GroupQuery.cs
- GridViewUpdateEventArgs.cs
- Parsers.cs
- MonthChangedEventArgs.cs
- HttpRequestCacheValidator.cs
- DockingAttribute.cs
- ScriptServiceAttribute.cs
- ObsoleteAttribute.cs
- BitmapEffectInput.cs
- CodeParameterDeclarationExpressionCollection.cs
- TraceHelpers.cs
- UriParserTemplates.cs
- PreProcessor.cs
- Message.cs
- HostedTcpTransportManager.cs
- TypeUnloadedException.cs
- ErrorFormatter.cs
- ListContractAdapter.cs
- HttpException.cs
- AutoScrollHelper.cs
- Keywords.cs
- ConfigurationException.cs
- thaishape.cs
- TransactionInformation.cs
- XmlSchemaElement.cs
- ParseChildrenAsPropertiesAttribute.cs
- Window.cs
- ScrollItemPattern.cs
- HostProtectionException.cs
- ZeroOpNode.cs
- CriticalFileToken.cs
- AuthenticationSection.cs
- Symbol.cs
- ClientSideQueueItem.cs
- ApplicationFileCodeDomTreeGenerator.cs
- UpdateTranslator.cs
- SystemResourceKey.cs
- FontWeightConverter.cs
- SqlDataSourceFilteringEventArgs.cs
- FileCodeGroup.cs
- CategoryEditor.cs
- EFTableProvider.cs
- ServiceSecurityAuditElement.cs
- ProjectedWrapper.cs
- _TimerThread.cs
- Ref.cs
- SerializationInfo.cs
- DataRecordInternal.cs
- TdsParserSessionPool.cs
- DocumentApplicationJournalEntry.cs
- BamlRecordReader.cs
- TableCell.cs
- ComplexBindingPropertiesAttribute.cs
- IndexedString.cs
- CheckPair.cs
- DataGridViewCellEventArgs.cs
- PropertyPath.cs
- FileNameEditor.cs
- Win32SafeHandles.cs
- Point3DAnimationBase.cs
- mda.cs
- EncodingInfo.cs
- DynamicAttribute.cs
- sortedlist.cs
- UserPersonalizationStateInfo.cs
- ToolStripTextBox.cs
- PageParserFilter.cs
- TrackPoint.cs
- FigureHelper.cs
- CacheEntry.cs
- CodeNamespaceImportCollection.cs