public ParticipantEnlistment(ProtocolState state, Enlistment enlistment, Guid enlistmentId, EndpointAddress service) : base(state, enlistmentId)
 {
     base.enlistment = enlistment;
     base.enlistment.ProtocolProviderContext = this;
     this.protocol = Microsoft.Transactions.Wsat.Messaging.ControlProtocol.Durable2PC;
     base.stateMachine = new DurableStateMachine(this);
     this.participantProxy = state.TryCreateTwoPhaseCommitParticipantProxy(service);
     if (this.participantProxy == null)
     {
         if (RecoveredParticipantInvalidMetadataRecord.ShouldTrace)
         {
             RecoveredParticipantInvalidMetadataRecord.Trace(base.enlistmentId, enlistment.RemoteTransactionId, service, base.state.ProtocolVersion);
         }
         base.stateMachine.ChangeState(state.States.DurableFailedRecovery);
     }
     else
     {
         base.stateMachine.ChangeState(state.States.DurableRecovering);
     }
     base.AddToLookupTable();
 }
        public ParticipantEnlistment(ProtocolState state, WsatRegistrationHeader header, Microsoft.Transactions.Wsat.Messaging.ControlProtocol protocol, TwoPhaseCommitParticipantProxy proxy) : base(state)
        {
            this.protocol = protocol;
            proxy.AddRef();
            this.participantProxy = proxy;
            this.ConfigureEnlistment(header);
            this.CreateCoordinatorService();
            switch (protocol)
            {
                case Microsoft.Transactions.Wsat.Messaging.ControlProtocol.Volatile2PC:
                    base.stateMachine = new VolatileStateMachine(this);
                    base.stateMachine.ChangeState(state.States.VolatileRegistering);
                    return;

                case Microsoft.Transactions.Wsat.Messaging.ControlProtocol.Durable2PC:
                    base.stateMachine = new DurableStateMachine(this);
                    base.stateMachine.ChangeState(state.States.DurableRegistering);
                    return;
            }
            Microsoft.Transactions.Bridge.DiagnosticUtility.FailFast("Invalid protocol");
        }
 private void OnPoliteSendComplete(IAsyncResult ar, TwoPhaseCommitParticipantProxy proxy)
 {
     try
     {
         proxy.EndSendMessage(ar);
     }
     catch (WsatSendFailureException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         DebugTrace.TraceSendFailure(exception);
         this.state.Perf.MessageSendFailureCountPerInterval.Increment();
     }
 }