Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextElementEnumerator.cs
- SafeViewOfFileHandle.cs
- MsdtcClusterUtils.cs
- TextUtf8RawTextWriter.cs
- PassportAuthenticationModule.cs
- DbBuffer.cs
- FileClassifier.cs
- ApplicationManager.cs
- DbgCompiler.cs
- HashCryptoHandle.cs
- MiniConstructorInfo.cs
- TraceData.cs
- SoundPlayer.cs
- CounterCreationData.cs
- SqlWriter.cs
- ReadOnlyDictionary.cs
- HandleCollector.cs
- TreeNode.cs
- InkCanvasSelection.cs
- EpmSourcePathSegment.cs
- UTF32Encoding.cs
- Error.cs
- ObjectListGeneralPage.cs
- C14NUtil.cs
- GridToolTip.cs
- XmlSchemaComplexType.cs
- StandardTransformFactory.cs
- VectorAnimationBase.cs
- CryptoApi.cs
- Rules.cs
- XAMLParseException.cs
- TableLayoutStyle.cs
- DataGridPagingPage.cs
- CfgSemanticTag.cs
- SchemaImporter.cs
- SocketElement.cs
- PerformanceCounterPermissionEntry.cs
- MethodToken.cs
- Line.cs
- NotFiniteNumberException.cs
- XamlTemplateSerializer.cs
- WebPartTransformerAttribute.cs
- PermissionSet.cs
- ErrorFormatterPage.cs
- UndoUnit.cs
- HostSecurityManager.cs
- CSharpCodeProvider.cs
- XmlMembersMapping.cs
- XmlBindingWorker.cs
- ImportDesigner.xaml.cs
- SynchronizationScope.cs
- Activity.cs
- TracingConnectionListener.cs
- HtmlLink.cs
- TextReader.cs
- InstanceOwnerException.cs
- ZipIORawDataFileBlock.cs
- XmlSchemaSimpleTypeUnion.cs
- SecurityKeyIdentifierClause.cs
- Point3DAnimationBase.cs
- ControlBuilderAttribute.cs
- BitmapImage.cs
- InkSerializer.cs
- RowSpanVector.cs
- PathTooLongException.cs
- DependencyPropertyChangedEventArgs.cs
- DefaultPropertyAttribute.cs
- FastEncoder.cs
- TypeDescriptorContext.cs
- SoundPlayer.cs
- XmlHierarchyData.cs
- Size3DConverter.cs
- CodeAccessPermission.cs
- ProgressBarRenderer.cs
- RequestCachingSection.cs
- ParameterElement.cs
- mediaclock.cs
- MimeParameter.cs
- ServiceModelConfiguration.cs
- UTF32Encoding.cs
- ToolStripDropDownMenu.cs
- Formatter.cs
- UrlAuthorizationModule.cs
- PathSegment.cs
- ProfileServiceManager.cs
- TypefaceCollection.cs
- sqlnorm.cs
- ConfigXmlSignificantWhitespace.cs
- BitmapPalette.cs
- FlowLayoutPanel.cs
- AddInPipelineAttributes.cs
- ApplyImportsAction.cs
- Array.cs
- XmlSignificantWhitespace.cs
- GPRECT.cs
- DocumentStatusResources.cs
- ChildDocumentBlock.cs
- Assert.cs
- HttpConfigurationContext.cs
- TokenBasedSetEnumerator.cs