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
- FloaterParaClient.cs
- ConfigurationLockCollection.cs
- SystemSounds.cs
- TextInfo.cs
- GridLength.cs
- CompoundFileIOPermission.cs
- StateDesigner.cs
- HttpCapabilitiesBase.cs
- SchemaElementLookUpTable.cs
- UInt64Converter.cs
- GeneralTransform.cs
- FtpWebRequest.cs
- DiscoveryMessageSequence.cs
- _BufferOffsetSize.cs
- MessageDecoder.cs
- HostProtectionPermission.cs
- Rotation3D.cs
- ComNativeDescriptor.cs
- XmlSchemaSimpleTypeList.cs
- Stylesheet.cs
- SessionStateContainer.cs
- HtmlInputText.cs
- DummyDataSource.cs
- ResourceIDHelper.cs
- HtmlTernaryTree.cs
- SourceElementsCollection.cs
- AspNetSynchronizationContext.cs
- RectIndependentAnimationStorage.cs
- DesignerSerializationManager.cs
- ScanQueryOperator.cs
- SQLInt32Storage.cs
- ResolvedKeyFrameEntry.cs
- RoleManagerModule.cs
- X509Utils.cs
- CommandLibraryHelper.cs
- ServiceHostingEnvironment.cs
- IList.cs
- ConfigViewGenerator.cs
- PhysicalAddress.cs
- MgmtConfigurationRecord.cs
- _ConnectOverlappedAsyncResult.cs
- XmlDictionaryString.cs
- DbgUtil.cs
- GridViewColumnCollectionChangedEventArgs.cs
- xsdvalidator.cs
- VirtualDirectoryMapping.cs
- RegexMatch.cs
- TreeNode.cs
- WindowsAuthenticationEventArgs.cs
- ProtocolsConfigurationEntry.cs
- GridViewAutoFormat.cs
- FixedSOMFixedBlock.cs
- PageRequestManager.cs
- VisualStyleTypesAndProperties.cs
- SectionRecord.cs
- DSASignatureFormatter.cs
- TagMapInfo.cs
- GenericXmlSecurityToken.cs
- MessageQueuePermissionEntryCollection.cs
- XmlNode.cs
- ReadOnlyNameValueCollection.cs
- LinqDataSourceContextEventArgs.cs
- HttpHandlersInstallComponent.cs
- RuleInfoComparer.cs
- LineInfo.cs
- SyndicationItemFormatter.cs
- TabItemAutomationPeer.cs
- TypeInfo.cs
- PTConverter.cs
- ThrowHelper.cs
- PreservationFileWriter.cs
- TypeGeneratedEventArgs.cs
- SettingsPropertyCollection.cs
- StateDesigner.Helpers.cs
- ElementHost.cs
- DecoderBestFitFallback.cs
- ResourceExpression.cs
- BufferModeSettings.cs
- JournalEntryStack.cs
- LOSFormatter.cs
- MSG.cs
- connectionpool.cs
- PropertyItem.cs
- AutoResizedEvent.cs
- RtType.cs
- DependencyObjectPropertyDescriptor.cs
- BackStopAuthenticationModule.cs
- DrawToolTipEventArgs.cs
- VectorCollection.cs
- Model3DGroup.cs
- MultiByteCodec.cs
- PeerDuplexChannel.cs
- PersonalizationEntry.cs
- DecimalConstantAttribute.cs
- CapabilitiesRule.cs
- Util.cs
- Table.cs
- FunctionParameter.cs
- AnnotationMap.cs
- XmlNotation.cs