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
- ActivationArguments.cs
- XmlWriterTraceListener.cs
- ValueExpressions.cs
- VolatileResourceManager.cs
- UnsafeNativeMethods.cs
- Substitution.cs
- ConfigsHelper.cs
- RoutedEventHandlerInfo.cs
- Debug.cs
- RIPEMD160Managed.cs
- TimelineGroup.cs
- Vector3DAnimationBase.cs
- X509RawDataKeyIdentifierClause.cs
- SharedPerformanceCounter.cs
- StdValidatorsAndConverters.cs
- XXXInfos.cs
- WebConfigurationManager.cs
- WebResponse.cs
- XamlValidatingReader.cs
- MimeObjectFactory.cs
- CodeVariableDeclarationStatement.cs
- AspNetHostingPermission.cs
- ComplexBindingPropertiesAttribute.cs
- DockProviderWrapper.cs
- FilterQuery.cs
- XmlDataFileEditor.cs
- Point4D.cs
- HitTestWithGeometryDrawingContextWalker.cs
- StringReader.cs
- CompiledQueryCacheKey.cs
- RuntimeVariableList.cs
- Variable.cs
- Button.cs
- CodeTypeParameter.cs
- NamedPipeWorkerProcess.cs
- IntSecurity.cs
- TempFiles.cs
- StringResourceManager.cs
- XmlDataSource.cs
- EventMappingSettingsCollection.cs
- SqlDataSourceTableQuery.cs
- EntityException.cs
- HelpFileFileNameEditor.cs
- NullableBoolConverter.cs
- SearchForVirtualItemEventArgs.cs
- BackgroundFormatInfo.cs
- MemberExpression.cs
- BufferModeSettings.cs
- ExpressionPrefixAttribute.cs
- OutputCacheSettings.cs
- EntityUtil.cs
- NativeMethods.cs
- DrawingGroupDrawingContext.cs
- DataGridViewSelectedColumnCollection.cs
- EventDescriptor.cs
- ButtonChrome.cs
- HitTestWithPointDrawingContextWalker.cs
- Compiler.cs
- TextOutput.cs
- SecurityTokenTypes.cs
- WebBrowsableAttribute.cs
- DbFunctionCommandTree.cs
- XmlDeclaration.cs
- PageSettings.cs
- _Events.cs
- RenderCapability.cs
- DragDrop.cs
- ImageListDesigner.cs
- BufferedStream.cs
- SQLInt16.cs
- GenericAuthenticationEventArgs.cs
- StopRoutingHandler.cs
- DataGridViewDataErrorEventArgs.cs
- DataColumnPropertyDescriptor.cs
- ColorMatrix.cs
- DataGridViewColumnEventArgs.cs
- EntityDataSourceWrapper.cs
- PolyLineSegment.cs
- RuntimeCompatibilityAttribute.cs
- XMLUtil.cs
- RowToParametersTransformer.cs
- CompressedStack.cs
- DetailsViewRow.cs
- Type.cs
- CFStream.cs
- SctClaimDictionary.cs
- HiddenFieldPageStatePersister.cs
- EntitySqlQueryState.cs
- PersonalizationStateInfo.cs
- GetPageCompletedEventArgs.cs
- BaseProcessProtocolHandler.cs
- DataGridViewHitTestInfo.cs
- JobPageOrder.cs
- ButtonFieldBase.cs
- ExecutedRoutedEventArgs.cs
- IndexedEnumerable.cs
- UriParserTemplates.cs
- InputReport.cs
- EmissiveMaterial.cs
- ExtensionFile.cs