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
- DesignerDataRelationship.cs
- ToolStripDropDown.cs
- OciLobLocator.cs
- ArgumentException.cs
- ToolStripLabel.cs
- XmlDataCollection.cs
- ColumnClickEvent.cs
- DPCustomTypeDescriptor.cs
- SecurityCriticalDataForSet.cs
- DispatchChannelSink.cs
- WebPart.cs
- ConnectionManager.cs
- AudioException.cs
- MSHTMLHostUtil.cs
- ErrorReporting.cs
- RefreshPropertiesAttribute.cs
- AsymmetricSecurityProtocol.cs
- FreezableDefaultValueFactory.cs
- RadioButtonPopupAdapter.cs
- ContractMethodInfo.cs
- FixedPageStructure.cs
- BuilderInfo.cs
- DataTablePropertyDescriptor.cs
- LowerCaseStringConverter.cs
- FactoryMaker.cs
- ScaleTransform.cs
- WebPartAddingEventArgs.cs
- RightsManagementPermission.cs
- PropertyMapper.cs
- DbDataReader.cs
- ImageDrawing.cs
- FilterQuery.cs
- BroadcastEventHelper.cs
- DataGridPagingPage.cs
- BezierSegment.cs
- ServiceNameCollection.cs
- Timeline.cs
- WindowsSecurityToken.cs
- Validator.cs
- PackWebRequestFactory.cs
- CurrentTimeZone.cs
- Page.cs
- SerializationHelper.cs
- EncoderParameters.cs
- GlobalizationAssembly.cs
- DataRowCollection.cs
- OleDbReferenceCollection.cs
- PostBackTrigger.cs
- TreeView.cs
- DefaultTraceListener.cs
- GeometryHitTestResult.cs
- TimersDescriptionAttribute.cs
- SecurityChannelFactory.cs
- CheckedPointers.cs
- Source.cs
- WindowsRichEdit.cs
- ActivationServices.cs
- TypeSystem.cs
- ScrollBarAutomationPeer.cs
- IpcChannelHelper.cs
- ReverseInheritProperty.cs
- OleDbDataAdapter.cs
- WpfGeneratedKnownTypes.cs
- Exception.cs
- CachedResourceDictionaryExtension.cs
- Misc.cs
- UniqueID.cs
- SqlUDTStorage.cs
- WebPartsSection.cs
- StretchValidation.cs
- GenericTypeParameterBuilder.cs
- ToolTip.cs
- InheritanceAttribute.cs
- ColorDialog.cs
- Vector3DCollection.cs
- FileAuthorizationModule.cs
- BamlResourceSerializer.cs
- SimpleBitVector32.cs
- PersianCalendar.cs
- CurrentChangingEventArgs.cs
- AttributeCollection.cs
- input.cs
- GroupItemAutomationPeer.cs
- TcpProcessProtocolHandler.cs
- FacetChecker.cs
- TargetInvocationException.cs
- AsnEncodedData.cs
- MessageLogTraceRecord.cs
- SecurityTokenRequirement.cs
- PipeConnection.cs
- RepeaterItem.cs
- MonikerSyntaxException.cs
- Avt.cs
- XmlChoiceIdentifierAttribute.cs
- RemoteWebConfigurationHostServer.cs
- KoreanLunisolarCalendar.cs
- documentsequencetextcontainer.cs
- webproxy.cs
- RotateTransform.cs
- DataGridHeaderBorder.cs