Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / TransactionOptions.cs / 1305376 / TransactionOptions.cs
using System; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; namespace System.Transactions { public struct TransactionOptions { private TimeSpan timeout; private System.Transactions.IsolationLevel isolationLevel; public TimeSpan Timeout { get { return this.timeout; } set { this.timeout = value; } } public System.Transactions.IsolationLevel IsolationLevel { get { return this.isolationLevel; } set { this.isolationLevel = value; } } public override int GetHashCode() { return base.GetHashCode(); // Don't have anything better to do. } public override bool Equals( object obj ) { if( !(obj is TransactionOptions) ) { // Can't use 'as' for a value type return false; } TransactionOptions opts = (TransactionOptions)obj; return (opts.timeout == this.timeout) && (opts.isolationLevel == this.isolationLevel); } // Changing paramater names would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public static bool operator==( TransactionOptions x, TransactionOptions y ) { return x.Equals( y ); } // Changing paramater names would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public static bool operator!=( TransactionOptions x, TransactionOptions y ) { return !x.Equals( y ); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; namespace System.Transactions { public struct TransactionOptions { private TimeSpan timeout; private System.Transactions.IsolationLevel isolationLevel; public TimeSpan Timeout { get { return this.timeout; } set { this.timeout = value; } } public System.Transactions.IsolationLevel IsolationLevel { get { return this.isolationLevel; } set { this.isolationLevel = value; } } public override int GetHashCode() { return base.GetHashCode(); // Don't have anything better to do. } public override bool Equals( object obj ) { if( !(obj is TransactionOptions) ) { // Can't use 'as' for a value type return false; } TransactionOptions opts = (TransactionOptions)obj; return (opts.timeout == this.timeout) && (opts.isolationLevel == this.isolationLevel); } // Changing paramater names would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public static bool operator==( TransactionOptions x, TransactionOptions y ) { return x.Equals( y ); } // Changing paramater names would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public static bool operator!=( TransactionOptions x, TransactionOptions y ) { return !x.Equals( y ); } } } // 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
- PersonalizationStateQuery.cs
- UndirectedGraph.cs
- TaskFormBase.cs
- SQlBooleanStorage.cs
- GlyphingCache.cs
- LayoutUtils.cs
- AvTraceDetails.cs
- HuffCodec.cs
- InitializationEventAttribute.cs
- QuadraticBezierSegment.cs
- CommonXSendMessage.cs
- TouchFrameEventArgs.cs
- MasterPageParser.cs
- VideoDrawing.cs
- MethodBody.cs
- DynamicMethod.cs
- KnownTypeAttribute.cs
- KernelTypeValidation.cs
- SessionStateUtil.cs
- Literal.cs
- SelectingProviderEventArgs.cs
- CanonicalFontFamilyReference.cs
- BitmapMetadataEnumerator.cs
- LinqDataSourceStatusEventArgs.cs
- InputDevice.cs
- MessageQueueAccessControlEntry.cs
- followingsibling.cs
- MemberInfoSerializationHolder.cs
- PathFigureCollectionValueSerializer.cs
- ModelPerspective.cs
- validation.cs
- SelectionRange.cs
- SchemaMapping.cs
- BaseDataListPage.cs
- UnitySerializationHolder.cs
- ElapsedEventArgs.cs
- AssemblyNameProxy.cs
- OleDbConnectionFactory.cs
- StrokeRenderer.cs
- RadioButtonList.cs
- DataGridViewAddColumnDialog.cs
- OpenTypeLayoutCache.cs
- serverconfig.cs
- Scripts.cs
- XhtmlCssHandler.cs
- DataGridViewComboBoxCell.cs
- SelectQueryOperator.cs
- EventArgs.cs
- DbProviderFactory.cs
- WebHttpBinding.cs
- Keyboard.cs
- NativeMethods.cs
- ProfilePropertyNameValidator.cs
- ToolboxItemFilterAttribute.cs
- OdbcDataReader.cs
- MultiBinding.cs
- DefaultHttpHandler.cs
- TransactionTraceIdentifier.cs
- BitmapFrameEncode.cs
- LineGeometry.cs
- Filter.cs
- SQLBinaryStorage.cs
- StateManagedCollection.cs
- XmlReturnWriter.cs
- webeventbuffer.cs
- RbTree.cs
- UserNameSecurityToken.cs
- HtmlSelect.cs
- Converter.cs
- HandleRef.cs
- DiscoveryRequestHandler.cs
- ChangeTracker.cs
- SuppressMergeCheckAttribute.cs
- AppSettingsExpressionBuilder.cs
- SqlRowUpdatingEvent.cs
- LifetimeServices.cs
- GridViewSelectEventArgs.cs
- StringArrayConverter.cs
- WorkflowPageSetupDialog.cs
- SafeSecurityHelper.cs
- WaitHandleCannotBeOpenedException.cs
- COM2PropertyDescriptor.cs
- __ComObject.cs
- Int16KeyFrameCollection.cs
- XamlVector3DCollectionSerializer.cs
- RsaSecurityToken.cs
- Gdiplus.cs
- PropertyStore.cs
- BamlBinaryWriter.cs
- TileBrush.cs
- UrlRoutingHandler.cs
- FixUpCollection.cs
- HwndPanningFeedback.cs
- FileSystemWatcher.cs
- DateBoldEvent.cs
- SessionStateItemCollection.cs
- ShaderEffect.cs
- IssuedSecurityTokenParameters.cs
- DataControlImageButton.cs
- EventlogProvider.cs