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
- CounterSampleCalculator.cs
- ManualResetEventSlim.cs
- DrawListViewColumnHeaderEventArgs.cs
- StickyNoteHelper.cs
- GlyphElement.cs
- SpeechDetectedEventArgs.cs
- EventLogTraceListener.cs
- DispatcherSynchronizationContext.cs
- ToolStripItemCollection.cs
- Touch.cs
- SecurityKeyType.cs
- OutArgument.cs
- TargetException.cs
- SqlClientPermission.cs
- SoapRpcMethodAttribute.cs
- ClientTargetSection.cs
- Stack.cs
- ResourceWriter.cs
- CodeMemberField.cs
- UdpDuplexChannel.cs
- VectorCollectionValueSerializer.cs
- RelationshipEndCollection.cs
- InternalSafeNativeMethods.cs
- ProjectionCamera.cs
- NamespaceCollection.cs
- StateRuntime.cs
- KeyInterop.cs
- Byte.cs
- HandleRef.cs
- OleDbDataReader.cs
- SqlError.cs
- WebPermission.cs
- BasicExpressionVisitor.cs
- StorageAssociationTypeMapping.cs
- ConfigurationProperty.cs
- XPathScanner.cs
- ImageSource.cs
- ResourcePart.cs
- ScriptingAuthenticationServiceSection.cs
- CustomBindingElement.cs
- SqlDataSourceWizardForm.cs
- SharedPersonalizationStateInfo.cs
- PipelineModuleStepContainer.cs
- BuildResultCache.cs
- TaiwanLunisolarCalendar.cs
- OperatingSystemVersionCheck.cs
- ImageListUtils.cs
- GridViewDeleteEventArgs.cs
- AttributeUsageAttribute.cs
- ConfigurationElementProperty.cs
- XmlSchemaInclude.cs
- RelationshipEndMember.cs
- ClientApiGenerator.cs
- TitleStyle.cs
- RuntimeHandles.cs
- AttachedPropertyMethodSelector.cs
- MeasureItemEvent.cs
- SQLGuid.cs
- RightsManagementEncryptedStream.cs
- ImageBrush.cs
- ShadowGlyph.cs
- XsdDateTime.cs
- BrushValueSerializer.cs
- DecimalAnimationUsingKeyFrames.cs
- SmiContextFactory.cs
- StringHelper.cs
- ConfigurationPermission.cs
- MulticastNotSupportedException.cs
- basenumberconverter.cs
- NodeFunctions.cs
- ToolStripDropDownMenu.cs
- ConfigUtil.cs
- smtpconnection.cs
- WorkflowQueuingService.cs
- EventLogPermissionEntryCollection.cs
- TextRunCacheImp.cs
- ValidationError.cs
- BamlLocalizableResource.cs
- SchemaAttDef.cs
- WebBrowserProgressChangedEventHandler.cs
- XmlHelper.cs
- FilterException.cs
- Vector3DCollection.cs
- NetworkInterface.cs
- SqlPersonalizationProvider.cs
- ConfigXmlWhitespace.cs
- MultiView.cs
- BooleanFacetDescriptionElement.cs
- RSAPKCS1KeyExchangeFormatter.cs
- PermissionToken.cs
- _BufferOffsetSize.cs
- _HelperAsyncResults.cs
- X509PeerCertificateElement.cs
- TrackingLocation.cs
- DropSourceBehavior.cs
- CannotUnloadAppDomainException.cs
- XmlQueryContext.cs
- VisualCollection.cs
- AsymmetricAlgorithm.cs
- EncodingTable.cs