Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Int32Storage.cs
- DataSourceCache.cs
- WebReferencesBuildProvider.cs
- PersonalizationAdministration.cs
- TableRow.cs
- SchemaCollectionCompiler.cs
- GridViewCommandEventArgs.cs
- _ScatterGatherBuffers.cs
- ContextBase.cs
- EndCreateSecurityTokenRequest.cs
- DBDataPermission.cs
- FormatterConverter.cs
- COM2PropertyDescriptor.cs
- MetadataExchangeClient.cs
- MatrixTransform3D.cs
- HtmlValidatorAdapter.cs
- TemplateApplicationHelper.cs
- OleDbRowUpdatingEvent.cs
- DateTimeValueSerializerContext.cs
- DrawToolTipEventArgs.cs
- PropertyGridCommands.cs
- TdsParameterSetter.cs
- WmlControlAdapter.cs
- Object.cs
- AutoGeneratedFieldProperties.cs
- ProfileManager.cs
- RtfToken.cs
- ReceiveDesigner.xaml.cs
- PreProcessInputEventArgs.cs
- TextRunTypographyProperties.cs
- UTF7Encoding.cs
- GPPOINT.cs
- SupportsEventValidationAttribute.cs
- PathStreamGeometryContext.cs
- ZipIOExtraFieldPaddingElement.cs
- XPathSelfQuery.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ListParagraph.cs
- ObjectParameterCollection.cs
- MasterPageBuildProvider.cs
- CodeExpressionStatement.cs
- ToolStripPanelRow.cs
- AttachedProperty.cs
- BitmapPalette.cs
- UpdateCommand.cs
- SuppressMergeCheckAttribute.cs
- CodeGotoStatement.cs
- IfElseDesigner.xaml.cs
- HandlerMappingMemo.cs
- SettingsContext.cs
- WebPartExportVerb.cs
- HelpEvent.cs
- InstancePersistenceEvent.cs
- TaskDesigner.cs
- AppDomain.cs
- CopyOnWriteList.cs
- IgnoreFlushAndCloseStream.cs
- MemoryPressure.cs
- TryExpression.cs
- XmlSchemaDocumentation.cs
- DifferencingCollection.cs
- ArrayEditor.cs
- X509Certificate.cs
- CacheEntry.cs
- ToolStripContainer.cs
- RequestQueryParser.cs
- SQLDecimalStorage.cs
- RSAPKCS1KeyExchangeFormatter.cs
- RuleRef.cs
- Nullable.cs
- SqlError.cs
- SelectionItemPattern.cs
- DragEvent.cs
- NonParentingControl.cs
- ItemDragEvent.cs
- Item.cs
- Calendar.cs
- SapiInterop.cs
- DefaultMemberAttribute.cs
- XmlValueConverter.cs
- SizeConverter.cs
- EdmType.cs
- HandledEventArgs.cs
- Stream.cs
- shaperfactoryquerycacheentry.cs
- MenuStrip.cs
- TypeValidationEventArgs.cs
- GraphicsContainer.cs
- XmlRawWriter.cs
- DispatchRuntime.cs
- WebPartsSection.cs
- QuinticEase.cs
- TableProviderWrapper.cs
- ClientTargetCollection.cs
- FixedSOMGroup.cs
- Menu.cs
- QuaternionRotation3D.cs
- ListViewTableRow.cs
- HostedHttpTransportManager.cs
- PageAsyncTask.cs