Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Stack.cs
- DataGridViewComboBoxColumnDesigner.cs
- FontCacheLogic.cs
- _UriSyntax.cs
- NamespaceList.cs
- SqlConnectionManager.cs
- TableCell.cs
- CopyOfAction.cs
- BlurBitmapEffect.cs
- OperationExecutionFault.cs
- FrameworkTemplate.cs
- UpdateTranslator.cs
- storepermissionattribute.cs
- StackSpiller.Bindings.cs
- TableDetailsRow.cs
- DataGridViewCellEventArgs.cs
- TreeNodeCollection.cs
- DeclarativeCatalogPartDesigner.cs
- GcSettings.cs
- UnmanagedMarshal.cs
- baseaxisquery.cs
- EntityDataSourceContainerNameConverter.cs
- ChangeBlockUndoRecord.cs
- ProfileEventArgs.cs
- MenuStrip.cs
- UIElementAutomationPeer.cs
- DynamicMethod.cs
- XmlElementAttributes.cs
- EntityDataSourceChangingEventArgs.cs
- QueryMatcher.cs
- DataColumnPropertyDescriptor.cs
- HighContrastHelper.cs
- GenerateTemporaryTargetAssembly.cs
- CodeDefaultValueExpression.cs
- FilterFactory.cs
- RichTextBox.cs
- XmlAttributeOverrides.cs
- HashCryptoHandle.cs
- ToolboxComponentsCreatedEventArgs.cs
- Visitor.cs
- ReadWriteObjectLock.cs
- Part.cs
- AddInIpcChannel.cs
- SchemaCollectionCompiler.cs
- Table.cs
- MenuCommands.cs
- NavigationPropertySingletonExpression.cs
- ColorConvertedBitmap.cs
- CheckBox.cs
- BitmapSizeOptions.cs
- BooleanSwitch.cs
- OdbcConnectionHandle.cs
- QueueProcessor.cs
- RoleManagerModule.cs
- Predicate.cs
- ObjectListCommand.cs
- PagedDataSource.cs
- UpDownBase.cs
- SqlExpressionNullability.cs
- ScaleTransform.cs
- EnumValAlphaComparer.cs
- HistoryEventArgs.cs
- WinFormsComponentEditor.cs
- StateWorkerRequest.cs
- RunInstallerAttribute.cs
- precedingsibling.cs
- WebPartConnectionsCancelVerb.cs
- InternalsVisibleToAttribute.cs
- DiagnosticTrace.cs
- PerspectiveCamera.cs
- HwndAppCommandInputProvider.cs
- SQlBooleanStorage.cs
- ContentElementAutomationPeer.cs
- TypeConverter.cs
- fixedPageContentExtractor.cs
- ConfigsHelper.cs
- ToolboxItemImageConverter.cs
- UriSectionData.cs
- RSAOAEPKeyExchangeDeformatter.cs
- TextFormatterContext.cs
- WinFormsComponentEditor.cs
- ButtonColumn.cs
- UnsafeNetInfoNativeMethods.cs
- TdsParameterSetter.cs
- Region.cs
- CollectionViewSource.cs
- UnionExpr.cs
- HtmlGenericControl.cs
- _DigestClient.cs
- MemberHolder.cs
- XmlImplementation.cs
- ColorContextHelper.cs
- SmiEventSink.cs
- ZipIOFileItemStream.cs
- TextEffect.cs
- Avt.cs
- XmlDownloadManager.cs
- TextParaLineResult.cs
- ContentHostHelper.cs
- ImageCollectionCodeDomSerializer.cs