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
- ProtocolsSection.cs
- PageCodeDomTreeGenerator.cs
- AxisAngleRotation3D.cs
- XmlSchemaRedefine.cs
- SpecialFolderEnumConverter.cs
- InlineObject.cs
- HttpModule.cs
- UntypedNullExpression.cs
- CodeAttributeArgument.cs
- SaveFileDialog.cs
- ObjectNavigationPropertyMapping.cs
- VersionPair.cs
- CodeTryCatchFinallyStatement.cs
- SortKey.cs
- CodeVariableDeclarationStatement.cs
- FontSourceCollection.cs
- WebConfigurationHostFileChange.cs
- XmlNodeChangedEventArgs.cs
- propertytag.cs
- UnicastIPAddressInformationCollection.cs
- Matrix3DValueSerializer.cs
- FocusWithinProperty.cs
- ProviderManager.cs
- ToolStripControlHost.cs
- AbandonedMutexException.cs
- DocumentViewerHelper.cs
- Random.cs
- UIElementParaClient.cs
- TextElementAutomationPeer.cs
- OleStrCAMarshaler.cs
- SoapReflectionImporter.cs
- BindingContext.cs
- ListBoxDesigner.cs
- CopyCodeAction.cs
- DataFormat.cs
- SystemFonts.cs
- OutOfMemoryException.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SecurityResources.cs
- GridViewPageEventArgs.cs
- OleDbCommandBuilder.cs
- DBConnectionString.cs
- KeyToListMap.cs
- ContainerVisual.cs
- FixedDocumentSequencePaginator.cs
- BitmapInitialize.cs
- OSFeature.cs
- ObservableDictionary.cs
- RenderOptions.cs
- StatusInfoItem.cs
- SrgsElementFactoryCompiler.cs
- TypeConstant.cs
- EntityKeyElement.cs
- SectionInput.cs
- RepeatInfo.cs
- CompensationExtension.cs
- GPRECTF.cs
- InboundActivityHelper.cs
- ParsedAttributeCollection.cs
- CodeAttributeArgumentCollection.cs
- CustomValidator.cs
- TableLayoutStyleCollection.cs
- control.ime.cs
- CodeTypeParameter.cs
- GenericPrincipal.cs
- TextRunCache.cs
- TextRangeBase.cs
- WebFormsRootDesigner.cs
- PKCS1MaskGenerationMethod.cs
- SqlCacheDependency.cs
- TagNameToTypeMapper.cs
- ToolStripItemRenderEventArgs.cs
- SelectionProcessor.cs
- XamlSerializerUtil.cs
- CollectionConverter.cs
- EntityContainer.cs
- MessageFilter.cs
- MetadataArtifactLoaderCompositeFile.cs
- FileIOPermission.cs
- UserControl.cs
- ManualResetEvent.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- DesignerOptionService.cs
- ListSourceHelper.cs
- Span.cs
- WebZone.cs
- PartialArray.cs
- ZipIOLocalFileHeader.cs
- NetworkStream.cs
- SQLByte.cs
- PenThreadPool.cs
- Calendar.cs
- TransformDescriptor.cs
- MinMaxParagraphWidth.cs
- BindingWorker.cs
- DbTransaction.cs
- EmptyElement.cs
- unsafenativemethodsother.cs
- QilXmlReader.cs
- VisualStyleRenderer.cs