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
- ToolStripPanel.cs
- ListBindableAttribute.cs
- CombinedTcpChannel.cs
- ValuePattern.cs
- XmlDataSourceView.cs
- WindowsTokenRoleProvider.cs
- XmlChoiceIdentifierAttribute.cs
- glyphs.cs
- Utilities.cs
- HttpServerVarsCollection.cs
- ServiceDescriptionImporter.cs
- Calendar.cs
- ParseNumbers.cs
- ActionFrame.cs
- ComplexPropertyEntry.cs
- X509SecurityTokenAuthenticator.cs
- InputMethod.cs
- DataControlImageButton.cs
- EdmValidator.cs
- NamedPipeHostedTransportConfiguration.cs
- RefExpr.cs
- SafeFileHandle.cs
- StackOverflowException.cs
- DiscardableAttribute.cs
- HtmlContainerControl.cs
- DataGridViewDataErrorEventArgs.cs
- WinFormsSecurity.cs
- XamlSerializationHelper.cs
- ExtenderProviderService.cs
- X509ChainPolicy.cs
- SignedInfo.cs
- LoginUtil.cs
- AuthorizationContext.cs
- WebReferencesBuildProvider.cs
- DebugHandleTracker.cs
- StickyNoteContentControl.cs
- TcpStreams.cs
- PerformanceCountersElement.cs
- ArraySubsetEnumerator.cs
- GPPOINT.cs
- UnsupportedPolicyOptionsException.cs
- BitmapSourceSafeMILHandle.cs
- QueryExpression.cs
- MessageRpc.cs
- ControlBuilder.cs
- DataListAutoFormat.cs
- TextProperties.cs
- BindingWorker.cs
- ObjectTokenCategory.cs
- FlowDocumentReaderAutomationPeer.cs
- SelectingProviderEventArgs.cs
- UniformGrid.cs
- TaskFactory.cs
- Cursors.cs
- GenericUriParser.cs
- ConfigurationValidatorBase.cs
- MultipartIdentifier.cs
- ToolStripSettings.cs
- HtmlDocument.cs
- UnsafeNativeMethods.cs
- METAHEADER.cs
- PeerName.cs
- DbConnectionInternal.cs
- UmAlQuraCalendar.cs
- XmlObjectSerializerContext.cs
- WmpBitmapDecoder.cs
- IconEditor.cs
- ConfigurationManagerInternal.cs
- XmlSchemaGroupRef.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- BitConverter.cs
- TreeNodeBindingCollection.cs
- UInt16.cs
- SessionState.cs
- SamlAttribute.cs
- SupportsEventValidationAttribute.cs
- Schema.cs
- UserNameSecurityToken.cs
- WinEventHandler.cs
- AnnotationDocumentPaginator.cs
- GenericEnumConverter.cs
- ScrollableControl.cs
- SubtreeProcessor.cs
- IIS7UserPrincipal.cs
- BitmapEffectvisualstate.cs
- HuffCodec.cs
- EntryPointNotFoundException.cs
- IfAction.cs
- UnionCodeGroup.cs
- SourceFileInfo.cs
- DBSchemaTable.cs
- IUnknownConstantAttribute.cs
- WebServicesSection.cs
- CodeCompileUnit.cs
- StreamGeometryContext.cs
- PrintingPermissionAttribute.cs
- Variant.cs
- DrawingGroup.cs
- XmlRootAttribute.cs
- DataTablePropertyDescriptor.cs