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
- ListParaClient.cs
- MenuAutomationPeer.cs
- XmlElementAttributes.cs
- RelationshipEndCollection.cs
- ObjectCacheSettings.cs
- HwndSourceKeyboardInputSite.cs
- DataBindEngine.cs
- FormatVersion.cs
- TextParagraphView.cs
- WebHttpSecurityModeHelper.cs
- cookie.cs
- ReflectionUtil.cs
- SuppressIldasmAttribute.cs
- DataGridRow.cs
- Buffer.cs
- PageWrapper.cs
- SystemParameters.cs
- Menu.cs
- AppearanceEditorPart.cs
- CookielessHelper.cs
- DataGridViewHitTestInfo.cs
- Line.cs
- NTAccount.cs
- TextLineBreak.cs
- ImageField.cs
- NonBatchDirectoryCompiler.cs
- QueryStringHandler.cs
- dtdvalidator.cs
- EmptyCollection.cs
- ItemsControl.cs
- ResourceLoader.cs
- HttpRequestCacheValidator.cs
- HttpCapabilitiesSectionHandler.cs
- EventLogRecord.cs
- AsymmetricCryptoHandle.cs
- ScrollableControl.cs
- ScriptControl.cs
- DragDropHelper.cs
- ComponentCommands.cs
- DesignerUtils.cs
- OnOperation.cs
- WebMessageEncoderFactory.cs
- DataStreamFromComStream.cs
- _NetworkingPerfCounters.cs
- ComponentRenameEvent.cs
- ToolStripSeparatorRenderEventArgs.cs
- StringOutput.cs
- unitconverter.cs
- SourceSwitch.cs
- WebEventCodes.cs
- StorageEntitySetMapping.cs
- ContentElement.cs
- SqlPersonalizationProvider.cs
- RightsManagementPermission.cs
- Lasso.cs
- HashCodeCombiner.cs
- SchemaSetCompiler.cs
- PrintingPermissionAttribute.cs
- ScrollPatternIdentifiers.cs
- DiagnosticsConfigurationHandler.cs
- RSAOAEPKeyExchangeDeformatter.cs
- MemberCollection.cs
- AutomationPatternInfo.cs
- PerformanceCounterLib.cs
- ListSortDescription.cs
- DataGridToolTip.cs
- LicFileLicenseProvider.cs
- SqlTypesSchemaImporter.cs
- InstanceDataCollection.cs
- MemberInitExpression.cs
- RecognizerStateChangedEventArgs.cs
- WeakEventTable.cs
- UInt32Storage.cs
- DetailsViewDeletedEventArgs.cs
- CacheDependency.cs
- DataGridToolTip.cs
- FormatStringEditor.cs
- DataGridViewToolTip.cs
- ListControl.cs
- SqlProviderManifest.cs
- DemultiplexingDispatchMessageFormatter.cs
- SearchExpression.cs
- UniqueConstraint.cs
- OperandQuery.cs
- XmlNodeReader.cs
- TitleStyle.cs
- TemplateInstanceAttribute.cs
- MultiSelectRootGridEntry.cs
- QilStrConcatenator.cs
- UntrustedRecipientException.cs
- DispatcherTimer.cs
- ImageButton.cs
- BitmapEffectDrawingContent.cs
- SafeCertificateContext.cs
- ObjectAnimationBase.cs
- TemplateField.cs
- AttributedMetaModel.cs
- SignedInfo.cs
- DesignerMetadata.cs
- CellTreeNodeVisitors.cs