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
- SpellerInterop.cs
- CorrelationManager.cs
- ParenthesizePropertyNameAttribute.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- OciEnlistContext.cs
- CatalogZone.cs
- ApplicationBuildProvider.cs
- HelpInfo.cs
- AttributeExtensions.cs
- ISO2022Encoding.cs
- NullEntityWrapper.cs
- DataBindingExpressionBuilder.cs
- AttachmentService.cs
- BooleanAnimationUsingKeyFrames.cs
- EmbeddedMailObjectsCollection.cs
- AppLevelCompilationSectionCache.cs
- NamespaceCollection.cs
- DecoderExceptionFallback.cs
- FlowchartSizeFeature.cs
- SQLResource.cs
- MasterPageParser.cs
- MessagePartDescription.cs
- ObjectSet.cs
- DependencyPropertyHelper.cs
- TextBox.cs
- PointCollection.cs
- DataGridViewButtonColumn.cs
- ConsoleCancelEventArgs.cs
- DocumentSequence.cs
- XamlStyleSerializer.cs
- RadialGradientBrush.cs
- FieldDescriptor.cs
- HttpResponseInternalWrapper.cs
- XmlByteStreamWriter.cs
- JsonClassDataContract.cs
- ApplicationDirectory.cs
- PartialList.cs
- XPathParser.cs
- GenericEnumConverter.cs
- ReflectionPermission.cs
- SizeLimitedCache.cs
- Identity.cs
- InputScopeConverter.cs
- DataServiceException.cs
- ExceptionUtility.cs
- AnnotationResource.cs
- BidPrivateBase.cs
- SuppressMessageAttribute.cs
- TripleDESCryptoServiceProvider.cs
- DataGridViewComboBoxCell.cs
- ScriptingRoleServiceSection.cs
- ZipIOLocalFileBlock.cs
- DbProviderFactory.cs
- TemplateParser.cs
- TextDecoration.cs
- StylusButtonCollection.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- SendSecurityHeaderElement.cs
- MD5.cs
- FamilyTypeface.cs
- MasterPageBuildProvider.cs
- TableLayoutPanel.cs
- CommandCollectionEditor.cs
- SHA256Managed.cs
- SQLConvert.cs
- JsonGlobals.cs
- ExternalException.cs
- SelectionRangeConverter.cs
- GridViewHeaderRowPresenter.cs
- UnsafeNativeMethods.cs
- Logging.cs
- MetadataCollection.cs
- XhtmlConformanceSection.cs
- TextBoxView.cs
- Attribute.cs
- TypeConverterMarkupExtension.cs
- SerialPinChanges.cs
- ZipIOExtraFieldPaddingElement.cs
- SchemaType.cs
- SqlEnums.cs
- DbParameterCollectionHelper.cs
- ModelMemberCollection.cs
- Pointer.cs
- SafeArrayRankMismatchException.cs
- IFlowDocumentViewer.cs
- TextEditorTyping.cs
- ResourceCategoryAttribute.cs
- EndpointAddressMessageFilterTable.cs
- HtmlGenericControl.cs
- HttpContextServiceHost.cs
- ListBox.cs
- StrokeCollection2.cs
- XmlDocumentFragment.cs
- PenThread.cs
- EmptyControlCollection.cs
- SID.cs
- SoapTypeAttribute.cs
- Cell.cs
- DigestComparer.cs
- XmlMtomReader.cs