Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BamlBinaryWriter.cs
- CustomAttribute.cs
- ProcessHostServerConfig.cs
- MediaTimeline.cs
- EditorServiceContext.cs
- SkinBuilder.cs
- SmiMetaData.cs
- InternalConfigEventArgs.cs
- WindowCollection.cs
- ExtenderProvidedPropertyAttribute.cs
- StringSource.cs
- Version.cs
- InputScopeAttribute.cs
- HandleCollector.cs
- EventLogPermissionAttribute.cs
- WebPartMinimizeVerb.cs
- HttpContextWrapper.cs
- FileDetails.cs
- Base64Decoder.cs
- ProfileProvider.cs
- PropertyItem.cs
- HandleRef.cs
- WindowClosedEventArgs.cs
- RotateTransform3D.cs
- UpdateTranslator.cs
- FormViewInsertEventArgs.cs
- DesignerSerializationOptionsAttribute.cs
- CodeDirectoryCompiler.cs
- _NestedSingleAsyncResult.cs
- SqlGenerator.cs
- CompiledRegexRunnerFactory.cs
- HtmlAnchor.cs
- Enum.cs
- DataServiceRequestException.cs
- ResourceManager.cs
- SaveCardRequest.cs
- ToolStripItemRenderEventArgs.cs
- XPathNodePointer.cs
- CommonDialog.cs
- HyperLinkStyle.cs
- Propagator.ExtentPlaceholderCreator.cs
- XmlLoader.cs
- TimerElapsedEvenArgs.cs
- Form.cs
- TextBoxAutoCompleteSourceConverter.cs
- XPathParser.cs
- Cursor.cs
- FacetDescription.cs
- Menu.cs
- Container.cs
- ConfigurationStrings.cs
- OdbcErrorCollection.cs
- MediaEntryAttribute.cs
- XmlIterators.cs
- TextReader.cs
- QilFactory.cs
- SafeNativeMethodsCLR.cs
- ArraySubsetEnumerator.cs
- DataViewManager.cs
- PackWebResponse.cs
- TrailingSpaceComparer.cs
- InvalidCastException.cs
- SimpleLine.cs
- ProcessModelSection.cs
- AvTraceDetails.cs
- StoreContentChangedEventArgs.cs
- SqlCacheDependencyDatabaseCollection.cs
- XmlSchemaExternal.cs
- CustomCategoryAttribute.cs
- LiteralLink.cs
- FullTrustAssembly.cs
- Contracts.cs
- ProtectedConfigurationSection.cs
- DecoderFallback.cs
- FlowLayoutPanel.cs
- TargetInvocationException.cs
- SchemaImporterExtension.cs
- WindowsRegion.cs
- ResourceManager.cs
- TrackPointCollection.cs
- DataGridItemEventArgs.cs
- XamlTypeMapper.cs
- DataObjectCopyingEventArgs.cs
- AuthenticationService.cs
- safex509handles.cs
- WorkflowIdleElement.cs
- SchemaImporterExtensionElementCollection.cs
- Evaluator.cs
- DocumentPageHost.cs
- FixedSchema.cs
- ComplexType.cs
- SQLUtility.cs
- SecurityKeyType.cs
- DBSchemaTable.cs
- CssStyleCollection.cs
- ButtonField.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- EdmToObjectNamespaceMap.cs
- DodSequenceMerge.cs
- MaskDescriptor.cs