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
- XmlValidatingReaderImpl.cs
- bidPrivateBase.cs
- TextEditorParagraphs.cs
- StaticExtension.cs
- PathGeometry.cs
- Point3DCollection.cs
- LocalFileSettingsProvider.cs
- HandledMouseEvent.cs
- GAC.cs
- ExtensionWindow.cs
- RNGCryptoServiceProvider.cs
- SHA384Managed.cs
- InsufficientMemoryException.cs
- EntityDataSource.cs
- RepeaterCommandEventArgs.cs
- InkCanvasSelectionAdorner.cs
- TemplateBindingExtensionConverter.cs
- initElementDictionary.cs
- RegexFCD.cs
- FtpWebRequest.cs
- PenThread.cs
- MachineKeySection.cs
- XmlNotation.cs
- Compiler.cs
- StylusPointProperties.cs
- latinshape.cs
- Opcode.cs
- TemplatingOptionsDialog.cs
- FontFamilyConverter.cs
- ButtonChrome.cs
- InputLangChangeEvent.cs
- PropertyNames.cs
- SplineKeyFrames.cs
- DataViewListener.cs
- SingleConverter.cs
- NameTable.cs
- IERequestCache.cs
- WebPartsPersonalization.cs
- NestedContainer.cs
- ListViewItemCollectionEditor.cs
- BookmarkScopeInfo.cs
- Stopwatch.cs
- DateTimeConverter.cs
- HandlerMappingMemo.cs
- WebMessageBodyStyleHelper.cs
- Config.cs
- MouseActionValueSerializer.cs
- PageRequestManager.cs
- SQLSingleStorage.cs
- PropertyValidationContext.cs
- Storyboard.cs
- WsatConfiguration.cs
- AssertSection.cs
- DefaultProxySection.cs
- XamlPointCollectionSerializer.cs
- AsnEncodedData.cs
- ExpressionBuilder.cs
- MetadataArtifactLoaderCompositeResource.cs
- _IPv6Address.cs
- SchemaMapping.cs
- HMACMD5.cs
- LineProperties.cs
- RegistrationServices.cs
- ReliableChannelBinder.cs
- XmlSchemaChoice.cs
- SqlCommandBuilder.cs
- CodePrimitiveExpression.cs
- XmlLangPropertyAttribute.cs
- safex509handles.cs
- FaultFormatter.cs
- WebPartConnectionsDisconnectVerb.cs
- WorkflowApplicationTerminatedException.cs
- RadioButtonBaseAdapter.cs
- StorageAssociationSetMapping.cs
- MenuTracker.cs
- CollectionViewGroup.cs
- AttributeConverter.cs
- COM2ColorConverter.cs
- InheritanceService.cs
- SiteMapDataSource.cs
- SoapMessage.cs
- BasePropertyDescriptor.cs
- CodeCatchClause.cs
- WebAdminConfigurationHelper.cs
- KnownBoxes.cs
- Activity.cs
- ControlPaint.cs
- PersistenceContextEnlistment.cs
- XmlEncodedRawTextWriter.cs
- PackUriHelper.cs
- DataGridViewSelectedCellCollection.cs
- DataServiceSaveChangesEventArgs.cs
- Config.cs
- ActiveXSite.cs
- ScrollBarAutomationPeer.cs
- DataGridViewCellFormattingEventArgs.cs
- DescendantBaseQuery.cs
- CultureInfo.cs
- GenericParameterDataContract.cs
- HebrewCalendar.cs