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
- PolyLineSegment.cs
- ReferencedCollectionType.cs
- DBBindings.cs
- XmlSchemaValidator.cs
- WebBaseEventKeyComparer.cs
- Module.cs
- objectresult_tresulttype.cs
- PointCollection.cs
- MultiSelectRootGridEntry.cs
- PropertyFilterAttribute.cs
- OuterGlowBitmapEffect.cs
- DropSourceBehavior.cs
- InfocardClientCredentials.cs
- SchemaInfo.cs
- recordstatescratchpad.cs
- InternalCache.cs
- TableCell.cs
- QilReplaceVisitor.cs
- BamlResourceSerializer.cs
- Matrix3DConverter.cs
- SoapMessage.cs
- ListViewHitTestInfo.cs
- DataRowChangeEvent.cs
- DocumentPageViewAutomationPeer.cs
- SafeFileMappingHandle.cs
- DrawingDrawingContext.cs
- WindowInteractionStateTracker.cs
- StaticContext.cs
- SubqueryRules.cs
- BooleanSwitch.cs
- AuthorizationRule.cs
- AllowedAudienceUriElementCollection.cs
- MulticastIPAddressInformationCollection.cs
- ExceptionHandlers.cs
- TextTreeInsertUndoUnit.cs
- InstanceContext.cs
- SQLRoleProvider.cs
- WorkflowRuntimeServiceElementCollection.cs
- UnsafeNativeMethods.cs
- WbemException.cs
- FrameworkElement.cs
- Rethrow.cs
- EFTableProvider.cs
- XhtmlBasicPanelAdapter.cs
- ProcessMonitor.cs
- UserControlParser.cs
- Int32KeyFrameCollection.cs
- unitconverter.cs
- SingleAnimationUsingKeyFrames.cs
- BaseUriHelper.cs
- DataTableTypeConverter.cs
- HttpWebResponse.cs
- HtmlElement.cs
- ComponentCollection.cs
- WebContext.cs
- FontStretchConverter.cs
- WebBrowserBase.cs
- FixedPageStructure.cs
- HtmlElementCollection.cs
- ScrollProperties.cs
- RpcAsyncResult.cs
- MetadataArtifactLoaderComposite.cs
- ClientRolePrincipal.cs
- DPTypeDescriptorContext.cs
- PeerInvitationResponse.cs
- XNodeNavigator.cs
- Form.cs
- PropertyInfoSet.cs
- SystemPens.cs
- ApplicationDirectoryMembershipCondition.cs
- StructuredCompositeActivityDesigner.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- DbDataReader.cs
- MatrixKeyFrameCollection.cs
- WorkflowDebuggerSteppingAttribute.cs
- TransactionManager.cs
- IdentitySection.cs
- XmlSchema.cs
- Light.cs
- XXXInfos.cs
- EntityTypeEmitter.cs
- Stack.cs
- SubMenuStyleCollection.cs
- CookielessData.cs
- RelatedPropertyManager.cs
- HitTestParameters.cs
- WriteStateInfoBase.cs
- IsolationInterop.cs
- XmlAttributeCollection.cs
- NextPreviousPagerField.cs
- IOThreadTimer.cs
- SqlCommand.cs
- ObjectContext.cs
- WorkflowMessageEventArgs.cs
- InfoCardBaseException.cs
- ButtonPopupAdapter.cs
- StateMachine.cs
- ExtendedPropertyDescriptor.cs
- SocketException.cs
- DiscoveryReference.cs