Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------------------------
//
// 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
- _IPv4Address.cs
- DateTimeHelper.cs
- MaterializeFromAtom.cs
- GraphicsContainer.cs
- TreeNodeSelectionProcessor.cs
- XmlSchemaExporter.cs
- Expr.cs
- PriorityQueue.cs
- MDIClient.cs
- PermissionListSet.cs
- MessageHeaderInfoTraceRecord.cs
- SplayTreeNode.cs
- EqualityComparer.cs
- QueryResponse.cs
- SQLSingle.cs
- WebSysDefaultValueAttribute.cs
- ConfigurationValidatorAttribute.cs
- TagPrefixCollection.cs
- UriExt.cs
- AnonymousIdentificationSection.cs
- RepeatInfo.cs
- WpfXamlLoader.cs
- ModulesEntry.cs
- MobileUserControl.cs
- WebCategoryAttribute.cs
- Persist.cs
- VirtualPathUtility.cs
- _ListenerResponseStream.cs
- SelectionEditor.cs
- TableLayoutStyleCollection.cs
- ListViewItemEventArgs.cs
- WCFServiceClientProxyGenerator.cs
- X509LogoTypeExtension.cs
- DataServiceQueryException.cs
- StateMachineSubscription.cs
- AvTraceDetails.cs
- ETagAttribute.cs
- UDPClient.cs
- smtppermission.cs
- AnimationLayer.cs
- ListViewItemCollectionEditor.cs
- WindowsRegion.cs
- UITypeEditor.cs
- _AuthenticationState.cs
- DataIdProcessor.cs
- InstanceHandleReference.cs
- AnimationTimeline.cs
- SpecularMaterial.cs
- ChannelSinkStacks.cs
- SortDescriptionCollection.cs
- Vars.cs
- PenLineCapValidation.cs
- DefaultEventAttribute.cs
- Panel.cs
- IResourceProvider.cs
- ResolveDuplexCD1AsyncResult.cs
- Rights.cs
- HtmlEmptyTagControlBuilder.cs
- BeginEvent.cs
- CompareValidator.cs
- XmlTextAttribute.cs
- SelectQueryOperator.cs
- MouseBinding.cs
- Main.cs
- HttpPostLocalhostServerProtocol.cs
- UserPreferenceChangedEventArgs.cs
- LassoSelectionBehavior.cs
- WindowsProgressbar.cs
- FormViewModeEventArgs.cs
- XsdDuration.cs
- RegexCapture.cs
- TimelineGroup.cs
- PolicyManager.cs
- Mutex.cs
- CodeGeneratorOptions.cs
- ColorConvertedBitmap.cs
- BufferAllocator.cs
- WindowsComboBox.cs
- ExtensionQuery.cs
- SQlBooleanStorage.cs
- SoapReflectionImporter.cs
- MenuAdapter.cs
- CodeVariableReferenceExpression.cs
- WebHttpSecurityElement.cs
- RMPublishingDialog.cs
- _ConnectOverlappedAsyncResult.cs
- FrameworkContextData.cs
- Closure.cs
- VectorAnimation.cs
- MasterPageParser.cs
- webproxy.cs
- PresentationTraceSources.cs
- ToolStripSplitButton.cs
- ColumnProvider.cs
- Visual3D.cs
- SmiSettersStream.cs
- RankException.cs
- RemotingSurrogateSelector.cs
- VectorKeyFrameCollection.cs
- MethodSignatureGenerator.cs