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
- SafeBitVector32.cs
- CustomValidator.cs
- EventMappingSettings.cs
- Group.cs
- SqlFileStream.cs
- MinimizableAttributeTypeConverter.cs
- CipherData.cs
- PartialCachingAttribute.cs
- FontUnitConverter.cs
- XmlDataProvider.cs
- listitem.cs
- SqlCacheDependencyDatabaseCollection.cs
- Margins.cs
- SiteMembershipCondition.cs
- PageParserFilter.cs
- XmlUnspecifiedAttribute.cs
- InputEventArgs.cs
- XmlSerializationWriter.cs
- WebBrowserUriTypeConverter.cs
- EventLogWatcher.cs
- CodeSnippetExpression.cs
- TableRowsCollectionEditor.cs
- SiteMapDataSource.cs
- XXXInfos.cs
- LogSwitch.cs
- SqlInternalConnectionSmi.cs
- FloatUtil.cs
- SspiWrapper.cs
- SizeChangedEventArgs.cs
- UnmanagedMemoryStreamWrapper.cs
- BinaryConverter.cs
- DrawListViewItemEventArgs.cs
- TableRowCollection.cs
- OptimalTextSource.cs
- TemplateControlBuildProvider.cs
- ScrollItemPatternIdentifiers.cs
- AssertFilter.cs
- Type.cs
- XPathAxisIterator.cs
- XslCompiledTransform.cs
- FileChangeNotifier.cs
- BinaryExpression.cs
- RijndaelManaged.cs
- OneOfConst.cs
- AsymmetricAlgorithm.cs
- SqlTypeSystemProvider.cs
- NavigationFailedEventArgs.cs
- ErrorRuntimeConfig.cs
- BindingCollection.cs
- WebPartEditVerb.cs
- SerializerProvider.cs
- WizardForm.cs
- CryptoStream.cs
- ConsumerConnectionPointCollection.cs
- ListenerPerfCounters.cs
- FontStretchConverter.cs
- ConnectionPoint.cs
- SHA1.cs
- ArgIterator.cs
- XmlSerializerSection.cs
- DataControlFieldCollection.cs
- ExecutedRoutedEventArgs.cs
- IncrementalReadDecoders.cs
- SignatureToken.cs
- CacheVirtualItemsEvent.cs
- JsonWriterDelegator.cs
- ControlCollection.cs
- GridView.cs
- LoginNameDesigner.cs
- Odbc32.cs
- BamlBinaryReader.cs
- FixedElement.cs
- EmptyCollection.cs
- ArcSegment.cs
- AsymmetricKeyExchangeDeformatter.cs
- Button.cs
- UnmanagedMemoryStreamWrapper.cs
- DynamicObjectAccessor.cs
- SqlHelper.cs
- RegexCode.cs
- ETagAttribute.cs
- ListViewInsertedEventArgs.cs
- TypedAsyncResult.cs
- RowToParametersTransformer.cs
- SecurityHelper.cs
- TextElementAutomationPeer.cs
- SizeAnimationClockResource.cs
- DoubleLink.cs
- Descriptor.cs
- AnonymousIdentificationSection.cs
- ObjectView.cs
- XhtmlTextWriter.cs
- TextEditorCharacters.cs
- FacetValues.cs
- RepeaterItemEventArgs.cs
- WindowsGraphics2.cs
- CodeExpressionCollection.cs
- SqlMethodTransformer.cs
- WebGetAttribute.cs
- HttpTransportElement.cs