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
- PathSegment.cs
- ImageSource.cs
- SecurityMessageProperty.cs
- GridPatternIdentifiers.cs
- LookupBindingPropertiesAttribute.cs
- SecurityChannelFaultConverter.cs
- SqlDependency.cs
- GradientSpreadMethodValidation.cs
- Lease.cs
- CacheAxisQuery.cs
- DrawingContext.cs
- RectAnimationBase.cs
- ColorTransformHelper.cs
- NullableIntMinMaxAggregationOperator.cs
- CharStorage.cs
- UInt32Converter.cs
- DispatchWrapper.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- DocumentReference.cs
- _FtpDataStream.cs
- As.cs
- DataBindingHandlerAttribute.cs
- KeyEventArgs.cs
- BinaryReader.cs
- SecurityHeaderLayout.cs
- XsdDataContractExporter.cs
- UserControlParser.cs
- SaveFileDialog.cs
- XmlNavigatorStack.cs
- WebPartManager.cs
- ImportOptions.cs
- SQLInt64.cs
- PeerCustomResolverSettings.cs
- MessageBox.cs
- SecurityUtils.cs
- ProfileServiceManager.cs
- AnimatedTypeHelpers.cs
- Propagator.ExtentPlaceholderCreator.cs
- PolicyValidationException.cs
- DefaultValueAttribute.cs
- DecoderFallback.cs
- loginstatus.cs
- ImageSourceTypeConverter.cs
- HMACSHA256.cs
- WmpBitmapEncoder.cs
- RawAppCommandInputReport.cs
- InvalidAsynchronousStateException.cs
- LayoutTable.cs
- Instrumentation.cs
- ObjectItemNoOpAssemblyLoader.cs
- StreamDocument.cs
- AddInPipelineAttributes.cs
- OdbcFactory.cs
- PagesSection.cs
- BufferedStream.cs
- RepeatButtonAutomationPeer.cs
- PrintEvent.cs
- DbCommandTree.cs
- FormsAuthenticationConfiguration.cs
- CodeAccessSecurityEngine.cs
- VirtualDirectoryMapping.cs
- TiffBitmapEncoder.cs
- AtlasWeb.Designer.cs
- DefaultTextStoreTextComposition.cs
- ExpressionSelection.cs
- UnsafeNativeMethods.cs
- ImpersonateTokenRef.cs
- SqlServer2KCompatibilityCheck.cs
- SqlDataSourceFilteringEventArgs.cs
- ToolStripSeparatorRenderEventArgs.cs
- PropertyReferenceSerializer.cs
- ConsoleCancelEventArgs.cs
- DayRenderEvent.cs
- Stopwatch.cs
- AnimationClock.cs
- ActivityMarkupSerializer.cs
- RoutedEventConverter.cs
- WebRequestModulesSection.cs
- Image.cs
- Matrix3DConverter.cs
- OperationCanceledException.cs
- Deflater.cs
- TextEditorLists.cs
- FormsAuthenticationEventArgs.cs
- PointAnimationUsingKeyFrames.cs
- ToolStripSettings.cs
- Underline.cs
- TimeSpanOrInfiniteConverter.cs
- Group.cs
- ConditionCollection.cs
- PathData.cs
- UseLicense.cs
- TextElementAutomationPeer.cs
- StorageRoot.cs
- View.cs
- LogEntrySerialization.cs
- UInt16Storage.cs
- DataGridViewLinkCell.cs
- InputProviderSite.cs
- SqlDataSourceConfigureSelectPanel.cs