Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / PreparingEnlistment.cs / 1305376 / PreparingEnlistment.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
#define DEMAND_TX_PERM
namespace System.Transactions
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Transactions;
using System.Transactions.Diagnostics;
public class PreparingEnlistment : Enlistment
{
internal PreparingEnlistment(
InternalEnlistment enlistment
) : base(enlistment)
{
}
public void Prepared()
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.Prepared"
);
EnlistmentCallbackPositiveTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
this.internalEnlistment.EnlistmentTraceId,
EnlistmentCallback.Prepared
);
}
lock( this.internalEnlistment.SyncRoot )
{
this.internalEnlistment.State.Prepared( this.internalEnlistment );
}
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.Prepared"
);
}
}
public void ForceRollback()
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
if ( DiagnosticTrace.Warning )
{
EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
this.internalEnlistment.EnlistmentTraceId,
EnlistmentCallback.ForceRollback
);
}
lock( this.internalEnlistment.SyncRoot )
{
this.internalEnlistment.State.ForceRollback( this.internalEnlistment, null );
}
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
}
// Changing the e paramater name would be a breaking change for little benefit.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
public void ForceRollback( Exception e )
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
if ( DiagnosticTrace.Warning )
{
EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
this.internalEnlistment.EnlistmentTraceId,
EnlistmentCallback.ForceRollback
);
}
lock( this.internalEnlistment.SyncRoot )
{
this.internalEnlistment.State.ForceRollback( this.internalEnlistment, e );
}
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
}
public byte[] RecoveryInformation()
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.RecoveryInformation"
);
}
try
{
lock( this.internalEnlistment.SyncRoot )
{
return this.internalEnlistment.State.RecoveryInformation( this.internalEnlistment );
}
}
finally
{
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.RecoveryInformation"
);
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
#define DEMAND_TX_PERM
namespace System.Transactions
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Transactions;
using System.Transactions.Diagnostics;
public class PreparingEnlistment : Enlistment
{
internal PreparingEnlistment(
InternalEnlistment enlistment
) : base(enlistment)
{
}
public void Prepared()
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.Prepared"
);
EnlistmentCallbackPositiveTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
this.internalEnlistment.EnlistmentTraceId,
EnlistmentCallback.Prepared
);
}
lock( this.internalEnlistment.SyncRoot )
{
this.internalEnlistment.State.Prepared( this.internalEnlistment );
}
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.Prepared"
);
}
}
public void ForceRollback()
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
if ( DiagnosticTrace.Warning )
{
EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
this.internalEnlistment.EnlistmentTraceId,
EnlistmentCallback.ForceRollback
);
}
lock( this.internalEnlistment.SyncRoot )
{
this.internalEnlistment.State.ForceRollback( this.internalEnlistment, null );
}
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
}
// Changing the e paramater name would be a breaking change for little benefit.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
public void ForceRollback( Exception e )
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
if ( DiagnosticTrace.Warning )
{
EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
this.internalEnlistment.EnlistmentTraceId,
EnlistmentCallback.ForceRollback
);
}
lock( this.internalEnlistment.SyncRoot )
{
this.internalEnlistment.State.ForceRollback( this.internalEnlistment, e );
}
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.ForceRollback"
);
}
}
public byte[] RecoveryInformation()
{
if ( DiagnosticTrace.Verbose )
{
MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.RecoveryInformation"
);
}
try
{
lock( this.internalEnlistment.SyncRoot )
{
return this.internalEnlistment.State.RecoveryInformation( this.internalEnlistment );
}
}
finally
{
if ( DiagnosticTrace.Verbose )
{
MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ),
"PreparingEnlistment.RecoveryInformation"
);
}
}
}
}
}
// 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
- ExpandedWrapper.cs
- IBuiltInEvidence.cs
- XmlSchemaAnnotation.cs
- securitycriticaldataClass.cs
- ItemList.cs
- HttpResponseHeader.cs
- TableRowGroupCollection.cs
- ProtocolsSection.cs
- COM2Enum.cs
- SymbolTable.cs
- CheckableControlBaseAdapter.cs
- MenuItemStyle.cs
- PixelFormat.cs
- AttributeSetAction.cs
- _IPv6Address.cs
- _BasicClient.cs
- DeferredReference.cs
- SubclassTypeValidatorAttribute.cs
- OneToOneMappingSerializer.cs
- AuthenticationModuleElement.cs
- RectangleGeometry.cs
- ScopelessEnumAttribute.cs
- PriorityItem.cs
- HuffCodec.cs
- OutputCacheProfile.cs
- DataGridViewDataConnection.cs
- SortedList.cs
- MediaSystem.cs
- CacheDependency.cs
- TargetInvocationException.cs
- SqlConnectionHelper.cs
- PaintEvent.cs
- ExpandCollapsePattern.cs
- ThicknessAnimationUsingKeyFrames.cs
- FormViewUpdatedEventArgs.cs
- WindowInteractionStateTracker.cs
- IPHostEntry.cs
- ValueHandle.cs
- ProjectionCamera.cs
- CompiledRegexRunnerFactory.cs
- IssuanceLicense.cs
- CryptographicAttribute.cs
- QilName.cs
- TcpTransportElement.cs
- mongolianshape.cs
- ListViewUpdatedEventArgs.cs
- RoutingService.cs
- RouteValueDictionary.cs
- ObsoleteAttribute.cs
- UrlMappingsModule.cs
- WebPartDisplayModeEventArgs.cs
- _ConnectStream.cs
- TcpTransportElement.cs
- DesignerRegionCollection.cs
- SmiEventStream.cs
- InitializationEventAttribute.cs
- PersistenceException.cs
- CssStyleCollection.cs
- RecognizedWordUnit.cs
- LinkClickEvent.cs
- EdmFunction.cs
- Compress.cs
- GridSplitterAutomationPeer.cs
- CommandHelpers.cs
- SafeLibraryHandle.cs
- GridViewUpdateEventArgs.cs
- TrustLevelCollection.cs
- XmlBoundElement.cs
- SerialErrors.cs
- BooleanFunctions.cs
- SymbolDocumentInfo.cs
- WebControlAdapter.cs
- EventPrivateKey.cs
- ActivityDesignerHelper.cs
- SqlServices.cs
- StartFileNameEditor.cs
- XXXOnTypeBuilderInstantiation.cs
- StringBlob.cs
- ProgressBar.cs
- RtType.cs
- AttributeTable.cs
- DragEvent.cs
- ListBoxDesigner.cs
- DataServiceException.cs
- NgenServicingAttributes.cs
- SocketException.cs
- XhtmlBasicSelectionListAdapter.cs
- BindToObject.cs
- DocumentReference.cs
- Int16Storage.cs
- PathFigureCollection.cs
- RelOps.cs
- ReflectEventDescriptor.cs
- PageBuildProvider.cs
- TextMessageEncodingElement.cs
- WebConfigurationManager.cs
- LicenseProviderAttribute.cs
- ListView.cs
- LocalFileSettingsProvider.cs
- PointAnimationClockResource.cs