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
- BrowserCapabilitiesFactory35.cs
- SecurityHelper.cs
- ProxyManager.cs
- BrowsableAttribute.cs
- XslTransform.cs
- TypeExtensions.cs
- MouseWheelEventArgs.cs
- PointLightBase.cs
- StaticExtensionConverter.cs
- XhtmlBasicPhoneCallAdapter.cs
- SqlMetaData.cs
- SharedStatics.cs
- MouseGestureConverter.cs
- Clock.cs
- MissingManifestResourceException.cs
- Int32RectConverter.cs
- PanelDesigner.cs
- ManagementInstaller.cs
- HwndTarget.cs
- WebPartTransformerCollection.cs
- InternalControlCollection.cs
- Int32Collection.cs
- sortedlist.cs
- DbParameterCollection.cs
- ChangeDirector.cs
- LockedHandleGlyph.cs
- ModelVisual3D.cs
- BooleanFunctions.cs
- ByteFacetDescriptionElement.cs
- GridViewUpdateEventArgs.cs
- ExclusiveCanonicalizationTransform.cs
- BitmapEffectrendercontext.cs
- NullableConverter.cs
- ExtentKey.cs
- EUCJPEncoding.cs
- ToolbarAUtomationPeer.cs
- ExtenderProviderService.cs
- SQLDoubleStorage.cs
- Int64.cs
- CultureInfoConverter.cs
- ConfigurationValues.cs
- KeySplineConverter.cs
- ConnectionManagementElementCollection.cs
- PipelineDeploymentState.cs
- TrackingExtract.cs
- ProjectionCamera.cs
- DataListItem.cs
- CatalogZoneAutoFormat.cs
- SafeNativeMethodsCLR.cs
- SmtpCommands.cs
- ContainerParagraph.cs
- CqlIdentifiers.cs
- EntityContainerAssociationSet.cs
- SettingsAttributes.cs
- CheckBoxFlatAdapter.cs
- ProtectedUri.cs
- RetrieveVirtualItemEventArgs.cs
- TreeNode.cs
- ProfileSettingsCollection.cs
- FrameworkContextData.cs
- TextDecorationCollectionConverter.cs
- ReadContentAsBinaryHelper.cs
- WorkflowCommandExtensionItem.cs
- WindowsTab.cs
- PartialToken.cs
- XPathNodeInfoAtom.cs
- PolyLineSegmentFigureLogic.cs
- HttpListenerResponse.cs
- XhtmlBasicFormAdapter.cs
- MdImport.cs
- RegexParser.cs
- TemplateControl.cs
- XPathEmptyIterator.cs
- SystemIcons.cs
- QuaternionIndependentAnimationStorage.cs
- RowToFieldTransformer.cs
- Pen.cs
- InfoCardKeyedHashAlgorithm.cs
- DrawingContextWalker.cs
- Int32EqualityComparer.cs
- SamlAction.cs
- ButtonBase.cs
- CompilerGlobalScopeAttribute.cs
- odbcmetadatacollectionnames.cs
- TreeIterators.cs
- IPEndPoint.cs
- StorageConditionPropertyMapping.cs
- XPathMultyIterator.cs
- WorkflowOperationAsyncResult.cs
- ConnectionStringSettings.cs
- ChannelServices.cs
- BinHexEncoder.cs
- DataGridColumnCollection.cs
- BamlRecords.cs
- SocketInformation.cs
- PrintDialog.cs
- FontNamesConverter.cs
- X509CertificateInitiatorClientCredential.cs
- SelectionProcessor.cs
- AutoCompleteStringCollection.cs