Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / SinglePhaseEnlistment.cs / 1305376 / SinglePhaseEnlistment.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions { using System; using System.Diagnostics; using System.Threading; using System.Transactions; using System.Transactions.Diagnostics; public class SinglePhaseEnlistment : Enlistment { internal SinglePhaseEnlistment( InternalEnlistment enlistment ) : base(enlistment) { } public void Aborted() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.Aborted ); } lock( this.internalEnlistment.SyncRoot ) { this.internalEnlistment.State.Aborted( this.internalEnlistment, null ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } } // Changing the e paramater name would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public void Aborted( Exception e ) { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.Aborted ); } lock( this.internalEnlistment.SyncRoot ) { this.internalEnlistment.State.Aborted( this.internalEnlistment, e ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } } public void Committed() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Committed" ); EnlistmentCallbackPositiveTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.Committed ); } lock( this.internalEnlistment.SyncRoot ) { this.internalEnlistment.State.Committed( this.internalEnlistment ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Committed" ); } } public void InDoubt() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } lock( this.internalEnlistment.SyncRoot ) { if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.InDoubt ); } this.internalEnlistment.State.InDoubt( this.internalEnlistment, null ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } } // Changing the e paramater name would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public void InDoubt( Exception e ) { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } lock( this.internalEnlistment.SyncRoot ) { if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.InDoubt ); } this.internalEnlistment.State.InDoubt( this.internalEnlistment, e ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeTypeDeclarationCollection.cs
- DbDataAdapter.cs
- AssociationEndMember.cs
- _UriTypeConverter.cs
- CategoryGridEntry.cs
- UInt16Storage.cs
- OpCodes.cs
- PropertyRef.cs
- StorageMappingItemLoader.cs
- CodeConstructor.cs
- ExecutionContext.cs
- SudsParser.cs
- FillBehavior.cs
- GeometryGroup.cs
- DocumentAutomationPeer.cs
- TileBrush.cs
- DocumentViewerBaseAutomationPeer.cs
- SqlDataAdapter.cs
- MultiByteCodec.cs
- ColorPalette.cs
- WpfSharedXamlSchemaContext.cs
- Style.cs
- X509CertificateChain.cs
- SchemaLookupTable.cs
- HtmlEmptyTagControlBuilder.cs
- EntityDataSourceWizardForm.cs
- MaterializeFromAtom.cs
- DateTimeFormat.cs
- TableLayout.cs
- DispatcherEventArgs.cs
- XamlTreeBuilderBamlRecordWriter.cs
- IxmlLineInfo.cs
- DictionaryEntry.cs
- ComponentManagerBroker.cs
- OdbcDataAdapter.cs
- SafeLibraryHandle.cs
- CacheAxisQuery.cs
- IDispatchConstantAttribute.cs
- HtmlTextArea.cs
- DetailsViewInsertedEventArgs.cs
- MetadataArtifactLoaderCompositeResource.cs
- FixedPosition.cs
- GlyphTypeface.cs
- TypedReference.cs
- OdbcError.cs
- XPathParser.cs
- CollectionContainer.cs
- UrlParameterReader.cs
- RoleService.cs
- BamlRecords.cs
- GPRECT.cs
- AsymmetricSignatureDeformatter.cs
- SoapExtensionImporter.cs
- LicenseContext.cs
- NativeRecognizer.cs
- SocketElement.cs
- Camera.cs
- ValueChangedEventManager.cs
- DependencyPropertyConverter.cs
- XmlSchemaSimpleContentRestriction.cs
- DrawListViewSubItemEventArgs.cs
- HelloMessage11.cs
- Transform3DGroup.cs
- MouseBinding.cs
- EventRecord.cs
- ContractBase.cs
- ContractCodeDomInfo.cs
- GeometryValueSerializer.cs
- Identifier.cs
- NamespaceInfo.cs
- TextStore.cs
- XmlSignatureProperties.cs
- ElementHostAutomationPeer.cs
- DesignerAttribute.cs
- _HTTPDateParse.cs
- FigureHelper.cs
- FacetDescription.cs
- ListControl.cs
- Axis.cs
- Command.cs
- ProcessModuleCollection.cs
- HtmlElement.cs
- GridPatternIdentifiers.cs
- Rect3DValueSerializer.cs
- NetStream.cs
- ListBindingConverter.cs
- DataGridViewCellStyleChangedEventArgs.cs
- CodeObject.cs
- Timeline.cs
- DataGridViewMethods.cs
- FindCompletedEventArgs.cs
- BooleanFunctions.cs
- MediaCommands.cs
- PanelStyle.cs
- HealthMonitoringSectionHelper.cs
- ZoneIdentityPermission.cs
- FontStyleConverter.cs
- RemoteCryptoDecryptRequest.cs
- COAUTHIDENTITY.cs
- TextFormatterImp.cs