Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / SinglePhaseEnlistment.cs / 1305376 / SinglePhaseEnlistment.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions { using System; using System.Diagnostics; using System.Threading; using System.Transactions; using System.Transactions.Diagnostics; public class SinglePhaseEnlistment : Enlistment { internal SinglePhaseEnlistment( InternalEnlistment enlistment ) : base(enlistment) { } public void Aborted() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.Aborted ); } lock( this.internalEnlistment.SyncRoot ) { this.internalEnlistment.State.Aborted( this.internalEnlistment, null ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } } // Changing the e paramater name would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public void Aborted( Exception e ) { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.Aborted ); } lock( this.internalEnlistment.SyncRoot ) { this.internalEnlistment.State.Aborted( this.internalEnlistment, e ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Aborted" ); } } public void Committed() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Committed" ); EnlistmentCallbackPositiveTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.Committed ); } lock( this.internalEnlistment.SyncRoot ) { this.internalEnlistment.State.Committed( this.internalEnlistment ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.Committed" ); } } public void InDoubt() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } lock( this.internalEnlistment.SyncRoot ) { if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.InDoubt ); } this.internalEnlistment.State.InDoubt( this.internalEnlistment, null ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } } // Changing the e paramater name would be a breaking change for little benefit. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public void InDoubt( Exception e ) { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } lock( this.internalEnlistment.SyncRoot ) { if ( DiagnosticTrace.Warning ) { EnlistmentCallbackNegativeTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.internalEnlistment.EnlistmentTraceId, EnlistmentCallback.InDoubt ); } this.internalEnlistment.State.InDoubt( this.internalEnlistment, e ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "SinglePhaseEnlistment.InDoubt" ); } } } } // 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
- ConstraintManager.cs
- Util.cs
- DoubleAnimationUsingPath.cs
- MetafileHeaderWmf.cs
- StateChangeEvent.cs
- GlyphTypeface.cs
- XmlDesigner.cs
- MimeFormReflector.cs
- PresentationTraceSources.cs
- MobileControlBuilder.cs
- TextEndOfParagraph.cs
- SemanticResolver.cs
- SupportingTokenSecurityTokenResolver.cs
- GridViewRowCollection.cs
- DataGridViewCellStyle.cs
- SQlBooleanStorage.cs
- LinqDataSource.cs
- DataGridViewAdvancedBorderStyle.cs
- TransactionManager.cs
- TextEffectCollection.cs
- SQLDecimal.cs
- SmiContextFactory.cs
- ErrorWebPart.cs
- ListCollectionView.cs
- COM2ExtendedBrowsingHandler.cs
- DataListItemEventArgs.cs
- OneWayBindingElementImporter.cs
- handlecollector.cs
- XmlReflectionMember.cs
- MessageUtil.cs
- LoginView.cs
- Run.cs
- PropertyTab.cs
- FormViewPageEventArgs.cs
- MergablePropertyAttribute.cs
- TTSEvent.cs
- BinHexEncoding.cs
- BezierSegment.cs
- SerialErrors.cs
- IncrementalHitTester.cs
- CodeGenerator.cs
- BindingSource.cs
- LateBoundBitmapDecoder.cs
- InputGestureCollection.cs
- CollectionView.cs
- XmlSchemaSet.cs
- EncryptedKeyIdentifierClause.cs
- MarkupWriter.cs
- ListItemParagraph.cs
- VisualStyleRenderer.cs
- UnaryNode.cs
- SslStream.cs
- XhtmlBasicPageAdapter.cs
- MarkupObject.cs
- ToolBarButton.cs
- PnrpPermission.cs
- TabItemAutomationPeer.cs
- XmlCollation.cs
- MetadataCollection.cs
- UidPropertyAttribute.cs
- SafeRightsManagementQueryHandle.cs
- XmlArrayAttribute.cs
- Menu.cs
- PrimitiveSchema.cs
- BoolExpr.cs
- RightsManagementSuppressedStream.cs
- ValidationErrorEventArgs.cs
- SqlRecordBuffer.cs
- wgx_exports.cs
- ContextMenu.cs
- TypeDescriptionProviderAttribute.cs
- ISAPIWorkerRequest.cs
- TextServicesProperty.cs
- VisualStateGroup.cs
- AlternateViewCollection.cs
- PnrpPermission.cs
- InfoCardArgumentException.cs
- SchemaSetCompiler.cs
- TextRenderer.cs
- AggregateNode.cs
- EllipticalNodeOperations.cs
- DataControlCommands.cs
- ScriptResourceInfo.cs
- CoreSwitches.cs
- NumericUpDownAccelerationCollection.cs
- ListView.cs
- SharedStatics.cs
- StopStoryboard.cs
- ListViewUpdateEventArgs.cs
- StylusButton.cs
- OrderPreservingSpoolingTask.cs
- basemetadatamappingvisitor.cs
- ExpressionPrinter.cs
- CodeIndexerExpression.cs
- SpellerInterop.cs
- HandlerElementCollection.cs
- StrokeNodeOperations.cs
- ToolStripTextBox.cs
- EntityRecordInfo.cs
- ProtocolsConfiguration.cs