Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ModulesEntry.cs
- InternalTypeHelper.cs
- Select.cs
- GlyphingCache.cs
- printdlgexmarshaler.cs
- Frame.cs
- WebPartCatalogCloseVerb.cs
- XmlHierarchicalEnumerable.cs
- SqlXml.cs
- DesignTimeVisibleAttribute.cs
- FixedDSBuilder.cs
- SrgsDocumentParser.cs
- WebPartMinimizeVerb.cs
- PreProcessInputEventArgs.cs
- ThreadStateException.cs
- ControlParser.cs
- PersonalizationProviderHelper.cs
- Cursors.cs
- PieceNameHelper.cs
- ScrollBar.cs
- DictionaryEntry.cs
- TypeConverterValueSerializer.cs
- DateTimeFormat.cs
- baseaxisquery.cs
- GridViewDeletedEventArgs.cs
- FacetValueContainer.cs
- RoleGroupCollection.cs
- ProgressiveCrcCalculatingStream.cs
- LambdaCompiler.Address.cs
- MinMaxParagraphWidth.cs
- GridItemPatternIdentifiers.cs
- Helper.cs
- DocumentOutline.cs
- Thread.cs
- ProxyFragment.cs
- EventSource.cs
- LogRecordSequence.cs
- GridItemPatternIdentifiers.cs
- RSAProtectedConfigurationProvider.cs
- BaseTreeIterator.cs
- NumericUpDown.cs
- COM2FontConverter.cs
- VirtualPathUtility.cs
- XmlSchemaComplexContentExtension.cs
- ToolStripMenuItem.cs
- wgx_sdk_version.cs
- FormatterServices.cs
- PassportIdentity.cs
- SqlTriggerContext.cs
- ListItemParagraph.cs
- AsymmetricKeyExchangeFormatter.cs
- InternalRelationshipCollection.cs
- MetadataElement.cs
- MimePart.cs
- ConfigurationUtility.cs
- Storyboard.cs
- ValidatingReaderNodeData.cs
- FormViewInsertedEventArgs.cs
- LinkTarget.cs
- BaseParser.cs
- ProcessInfo.cs
- RenderContext.cs
- PostBackOptions.cs
- BinaryMessageFormatter.cs
- CurrencyWrapper.cs
- ExpressionBuilderContext.cs
- TdsRecordBufferSetter.cs
- CodeDirectoryCompiler.cs
- ModelServiceImpl.cs
- SecurityPolicySection.cs
- DataTableMapping.cs
- KeyInfo.cs
- IRCollection.cs
- EmptyReadOnlyDictionaryInternal.cs
- TableCellAutomationPeer.cs
- OdbcConnectionPoolProviderInfo.cs
- ToolStripOverflowButton.cs
- OdbcConnectionStringbuilder.cs
- MultiByteCodec.cs
- StatusStrip.cs
- DesignerOptionService.cs
- MimeObjectFactory.cs
- TagMapInfo.cs
- System.Data.OracleClient_BID.cs
- EdmComplexPropertyAttribute.cs
- MatrixCamera.cs
- SectionInformation.cs
- EventProviderWriter.cs
- RoutedEventValueSerializer.cs
- Base64Encoder.cs
- DurationConverter.cs
- DockPanel.cs
- BuildProviderCollection.cs
- Operand.cs
- EntityRecordInfo.cs
- DataViewManager.cs
- DataContractSerializerSection.cs
- CompressEmulationStream.cs
- StateChangeEvent.cs
- ApplicationInfo.cs