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
- SecurityPermission.cs
- FontFamily.cs
- BlobPersonalizationState.cs
- XmlSchemaAppInfo.cs
- MediaElement.cs
- ClientSettingsStore.cs
- RelationshipManager.cs
- ThemeableAttribute.cs
- OrthographicCamera.cs
- OracleNumber.cs
- Renderer.cs
- StrongNameKeyPair.cs
- InheritanceUI.cs
- BitmapFrameDecode.cs
- ExecutionContext.cs
- IconBitmapDecoder.cs
- ObservableCollection.cs
- NamespaceList.cs
- WsatServiceAddress.cs
- DeferredTextReference.cs
- MulticastNotSupportedException.cs
- PenThreadPool.cs
- WSFederationHttpBindingElement.cs
- InfiniteTimeSpanConverter.cs
- ScriptReferenceEventArgs.cs
- OLEDB_Enum.cs
- Debugger.cs
- DbProviderFactories.cs
- DecoderBestFitFallback.cs
- TrackBarRenderer.cs
- TextContainer.cs
- CellLabel.cs
- Action.cs
- LayoutTable.cs
- XamlClipboardData.cs
- ProtectedConfiguration.cs
- RulePatternOps.cs
- _TransmitFileOverlappedAsyncResult.cs
- NumberFunctions.cs
- ConnectionManagementElementCollection.cs
- Rotation3D.cs
- PrePrepareMethodAttribute.cs
- WindowsComboBox.cs
- DeploymentSectionCache.cs
- x509store.cs
- MarkupProperty.cs
- EventWaitHandle.cs
- InfoCardArgumentException.cs
- ControlPaint.cs
- recordstatefactory.cs
- BindingNavigator.cs
- WebConfigurationHostFileChange.cs
- DetailsViewInsertedEventArgs.cs
- RequiredFieldValidator.cs
- BodyWriter.cs
- AsyncSerializedWorker.cs
- MetadataCacheItem.cs
- StylusPlugInCollection.cs
- CredentialCache.cs
- HtmlEmptyTagControlBuilder.cs
- XhtmlTextWriter.cs
- ContainerVisual.cs
- XmlReaderSettings.cs
- JpegBitmapDecoder.cs
- RsaSecurityToken.cs
- XmlDataImplementation.cs
- ExpressionBinding.cs
- DataGridViewCellStyleChangedEventArgs.cs
- DataKeyCollection.cs
- XmlAutoDetectWriter.cs
- DesignerDataTableBase.cs
- LinkDesigner.cs
- FragmentQueryProcessor.cs
- EdmToObjectNamespaceMap.cs
- EventMap.cs
- Publisher.cs
- AuthenticatedStream.cs
- FileDocument.cs
- ProtocolsConfigurationHandler.cs
- ToolStripItemRenderEventArgs.cs
- TrackingLocationCollection.cs
- DropDownButton.cs
- SqlNotificationRequest.cs
- AbstractDataSvcMapFileLoader.cs
- ApplicationFileParser.cs
- BaseProcessProtocolHandler.cs
- CompatibleComparer.cs
- EventMappingSettings.cs
- DocumentScope.cs
- GridViewDesigner.cs
- PersistenceTypeAttribute.cs
- SqlTypesSchemaImporter.cs
- ValidationRuleCollection.cs
- InstanceContext.cs
- ConfigXmlWhitespace.cs
- HighContrastHelper.cs
- MenuItemBindingCollection.cs
- CodeGenerator.cs
- Restrictions.cs
- errorpatternmatcher.cs