Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / WebBaseEventKeyComparer.cs / 1305376 / 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
- Converter.cs
- X509ChainPolicy.cs
- CacheEntry.cs
- ObjectManager.cs
- TransactionScope.cs
- FontWeight.cs
- WorkflowOwnershipException.cs
- TypeSystem.cs
- TextSelection.cs
- DesignerActionMethodItem.cs
- PersonalizationProviderHelper.cs
- InvokeGenerator.cs
- StylusButtonCollection.cs
- DefaultEventAttribute.cs
- FtpCachePolicyElement.cs
- EncryptedPackageFilter.cs
- NumericUpDownAccelerationCollection.cs
- XmlUrlResolver.cs
- BookmarkList.cs
- StorageAssociationTypeMapping.cs
- BevelBitmapEffect.cs
- ClientTarget.cs
- ThicknessConverter.cs
- OleDbCommand.cs
- LockingPersistenceProvider.cs
- MenuItemAutomationPeer.cs
- sqlcontext.cs
- Soap12ProtocolReflector.cs
- XamlStream.cs
- Size.cs
- MetadataUtil.cs
- SecurityKeyType.cs
- ConditionalWeakTable.cs
- Helpers.cs
- CharAnimationUsingKeyFrames.cs
- DynamicResourceExtensionConverter.cs
- ErrorRuntimeConfig.cs
- IndexedString.cs
- ExecutionEngineException.cs
- MethodExpr.cs
- DataGridViewTopLeftHeaderCell.cs
- XmlDocumentViewSchema.cs
- XmlSchemaAnyAttribute.cs
- RubberbandSelector.cs
- ProcessHost.cs
- DocumentOrderComparer.cs
- CodeSnippetTypeMember.cs
- NameHandler.cs
- OutputCacheProfileCollection.cs
- IntPtr.cs
- MenuItemCollection.cs
- LogFlushAsyncResult.cs
- ProcessHostFactoryHelper.cs
- BulletedListEventArgs.cs
- BindingGroup.cs
- ToolStripSeparatorRenderEventArgs.cs
- IdleTimeoutMonitor.cs
- HttpValueCollection.cs
- SelectionItemPattern.cs
- IsolatedStorageFileStream.cs
- SerializerWriterEventHandlers.cs
- XmlFormatExtensionPrefixAttribute.cs
- SQLGuidStorage.cs
- DiscoveryDocumentReference.cs
- Events.cs
- ContractReference.cs
- SizeChangedEventArgs.cs
- Component.cs
- Accessible.cs
- RootProjectionNode.cs
- ReachDocumentReferenceSerializerAsync.cs
- RequestTimeoutManager.cs
- DataGridRelationshipRow.cs
- DataSourceSelectArguments.cs
- WindowsRichEditRange.cs
- RequiredAttributeAttribute.cs
- BrowserPolicyValidator.cs
- Rotation3D.cs
- DataGridViewCell.cs
- TextSerializer.cs
- _Connection.cs
- SystemUnicastIPAddressInformation.cs
- DataGridTablesFactory.cs
- NumberSubstitution.cs
- MessageSecurityVersion.cs
- AliasExpr.cs
- GuidConverter.cs
- XamlTemplateSerializer.cs
- BaseConfigurationRecord.cs
- FeatureAttribute.cs
- AssemblyNameProxy.cs
- GenericPrincipal.cs
- SoapInteropTypes.cs
- TextRangeAdaptor.cs
- hwndwrapper.cs
- Grid.cs
- Package.cs
- AuthenticatingEventArgs.cs
- Rotation3D.cs
- PageMediaType.cs