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
- ImpersonateTokenRef.cs
- OledbConnectionStringbuilder.cs
- ScriptResourceAttribute.cs
- KeyGestureConverter.cs
- WebControlToolBoxItem.cs
- TimeoutException.cs
- SchemaNamespaceManager.cs
- XmlSchemaParticle.cs
- RowVisual.cs
- ExceptionUtil.cs
- Internal.cs
- XsltSettings.cs
- ProtocolViolationException.cs
- PeerTransportListenAddressValidatorAttribute.cs
- ConfigurationValidatorAttribute.cs
- ToolStrip.cs
- CommandDevice.cs
- ModuleElement.cs
- HyperLink.cs
- ContextStack.cs
- NegotiationTokenAuthenticatorStateCache.cs
- DeferredSelectedIndexReference.cs
- AppDomainManager.cs
- GlyphShapingProperties.cs
- XmlValidatingReaderImpl.cs
- PartManifestEntry.cs
- AssociationSet.cs
- ResourcesBuildProvider.cs
- EventPrivateKey.cs
- SamlNameIdentifierClaimResource.cs
- diagnosticsswitches.cs
- SoapObjectReader.cs
- SapiRecoInterop.cs
- ToolboxControl.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SetStoryboardSpeedRatio.cs
- XmlWrappingWriter.cs
- ToolStripOverflowButton.cs
- DependencyObject.cs
- ThicknessConverter.cs
- IFlowDocumentViewer.cs
- OleDbConnection.cs
- FieldToken.cs
- ClickablePoint.cs
- ExpressionParser.cs
- GatewayDefinition.cs
- CollectionViewGroupInternal.cs
- KeyGestureConverter.cs
- XmlNodeChangedEventArgs.cs
- ActivityBindForm.cs
- IsolationInterop.cs
- AttributeUsageAttribute.cs
- CompilationLock.cs
- TypefaceMetricsCache.cs
- DbgUtil.cs
- FilterElement.cs
- SkipQueryOptionExpression.cs
- ToolbarAUtomationPeer.cs
- DynamicPropertyReader.cs
- QueryableFilterRepeater.cs
- PerformanceCounterNameAttribute.cs
- MenuEventArgs.cs
- ProgressChangedEventArgs.cs
- SingleQueryOperator.cs
- DbBuffer.cs
- ChannelPoolSettingsElement.cs
- fixedPageContentExtractor.cs
- InternalConfigHost.cs
- TimeZone.cs
- NetNamedPipeSecurity.cs
- MasterPageBuildProvider.cs
- ThicknessAnimationBase.cs
- XmlSchemaObject.cs
- Int64Converter.cs
- ConstraintCollection.cs
- PrintDocument.cs
- XmlStringTable.cs
- MessageQueuePermissionEntryCollection.cs
- RoleServiceManager.cs
- Reference.cs
- ComponentDispatcherThread.cs
- OrderingInfo.cs
- Point3DCollectionValueSerializer.cs
- HttpPostClientProtocol.cs
- PolicyLevel.cs
- ContainerControl.cs
- EventSinkHelperWriter.cs
- XmlAttributeCollection.cs
- ConfigXmlText.cs
- EncoderParameter.cs
- EditableRegion.cs
- DataGridViewImageCell.cs
- FlowDocumentView.cs
- EntityKey.cs
- XmlSchemaSubstitutionGroup.cs
- SplineKeyFrames.cs
- ZipIOFileItemStream.cs
- ConstNode.cs
- RealizedColumnsBlock.cs
- AssemblyInfo.cs