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
- MatrixCamera.cs
- StringPropertyBuilder.cs
- FormViewCommandEventArgs.cs
- UpdatePanel.cs
- ComplexPropertyEntry.cs
- FirstQueryOperator.cs
- WindowsSidIdentity.cs
- LinkClickEvent.cs
- TreeViewImageKeyConverter.cs
- SmiContext.cs
- XmlSignificantWhitespace.cs
- ContentPresenter.cs
- ACE.cs
- MetadataCache.cs
- NavigationWindowAutomationPeer.cs
- AccessedThroughPropertyAttribute.cs
- IgnoreFileBuildProvider.cs
- ObjectConverter.cs
- SystemTcpStatistics.cs
- HttpPostServerProtocol.cs
- ImageAnimator.cs
- HTTPNotFoundHandler.cs
- ScriptControl.cs
- BindingMemberInfo.cs
- CompilerLocalReference.cs
- DrawingBrush.cs
- XmlSchemaSimpleContent.cs
- ObjectNotFoundException.cs
- ListDictionaryInternal.cs
- TreeNodeEventArgs.cs
- EndpointConfigContainer.cs
- CodeTypeReferenceCollection.cs
- FormClosingEvent.cs
- PageThemeCodeDomTreeGenerator.cs
- StringStorage.cs
- ToolStripDropDownClosedEventArgs.cs
- TextBox.cs
- prompt.cs
- MultiSelectRootGridEntry.cs
- Exceptions.cs
- ToolStripMenuItemCodeDomSerializer.cs
- WorkflowServiceAttributesTypeConverter.cs
- CodeEntryPointMethod.cs
- SettingsContext.cs
- QuotedStringFormatReader.cs
- DbgUtil.cs
- ProcessManager.cs
- QueryContext.cs
- XmlSerializer.cs
- ActivityBuilder.cs
- TypeConverterValueSerializer.cs
- HttpResponse.cs
- ZipIOFileItemStream.cs
- ScrollChrome.cs
- CorrelationResolver.cs
- nulltextcontainer.cs
- BinaryQueryOperator.cs
- SizeChangedEventArgs.cs
- DtdParser.cs
- SqlEnums.cs
- KeySpline.cs
- Pair.cs
- Setter.cs
- LayoutEvent.cs
- FixedPageStructure.cs
- OracleFactory.cs
- AttachedPropertyMethodSelector.cs
- UInt32Storage.cs
- BufferModeSettings.cs
- BitmapFrameEncode.cs
- Path.cs
- NameTable.cs
- DependencyPropertyAttribute.cs
- Enumerable.cs
- Simplifier.cs
- BamlLocalizationDictionary.cs
- SynchronizedPool.cs
- FacetValues.cs
- QueryCacheManager.cs
- FrugalList.cs
- EventHandlersStore.cs
- WindowsRegion.cs
- Int64Animation.cs
- SerializationInfoEnumerator.cs
- HierarchicalDataSourceControl.cs
- DataContractAttribute.cs
- Pair.cs
- RegexCapture.cs
- SecurityContext.cs
- MetadataItemCollectionFactory.cs
- References.cs
- InputLanguageManager.cs
- DbConnectionPoolCounters.cs
- ToolboxItemCollection.cs
- FileDetails.cs
- RawMouseInputReport.cs
- BuildProvider.cs
- DefaultParameterValueAttribute.cs
- EndPoint.cs
- ExpressionBindingCollection.cs