private void OnSendRegisterComplete(CoordinatorEnlistment coordinator, ControlProtocol protocol, IAsyncResult ar)
 {
     SynchronizationEvent event2;
     EndpointAddress to = null;
     try
     {
         RegisterResponse response = coordinator.RegistrationProxy.EndSendRegister(ar);
         to = response.CoordinatorProtocolService;
         TwoPhaseCommitCoordinatorProxy proxy = this.state.TryCreateTwoPhaseCommitCoordinatorProxy(to);
         if (proxy == null)
         {
             if (RegistrationCoordinatorResponseInvalidMetadataRecord.ShouldTrace)
             {
                 RegistrationCoordinatorResponseInvalidMetadataRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, to, null, this.state.ProtocolVersion);
             }
             event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
         }
         else
         {
             try
             {
                 if (protocol == ControlProtocol.Durable2PC)
                 {
                     event2 = new MsgRegisterDurableResponseEvent(coordinator, response, proxy);
                 }
                 else
                 {
                     VolatileCoordinatorEnlistment asyncState = (VolatileCoordinatorEnlistment) ar.AsyncState;
                     event2 = new MsgRegisterVolatileResponseEvent(asyncState, response, proxy);
                 }
             }
             finally
             {
                 proxy.Release();
             }
         }
     }
     catch (WsatFaultException exception)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning);
         event2 = new MsgRegistrationCoordinatorFaultEvent(coordinator, protocol, exception.Fault);
         if (RegistrationCoordinatorFaultedRecord.ShouldTrace)
         {
             RegistrationCoordinatorFaultedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception.Fault);
         }
     }
     catch (WsatMessagingException exception2)
     {
         Microsoft.Transactions.Bridge.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Warning);
         this.state.Perf.MessageSendFailureCountPerInterval.Increment();
         if (RegistrationCoordinatorFailedRecord.ShouldTrace)
         {
             RegistrationCoordinatorFailedRecord.Trace(coordinator.EnlistmentId, coordinator.SuperiorContext, protocol, exception2);
         }
         DebugTrace.TraceSendFailure(coordinator.EnlistmentId, exception2);
         event2 = new MsgRegistrationCoordinatorSendFailureEvent(coordinator);
     }
     coordinator.StateMachine.Enqueue(event2);
 }
 public virtual void OnEvent(MsgRegisterVolatileResponseEvent e)
 {
     this.InvalidRegistrationCoordinatorMessage(e);
 }
 private void InvalidRegistrationCoordinatorMessage(MsgRegisterVolatileResponseEvent e)
 {
     this.TraceInvalidEvent(e, false);
     this.TryToAbortTransaction(e, e.VolatileCoordinator);
 }
 public override void OnEvent(MsgRegisterVolatileResponseEvent e)
 {
     e.VolatileCoordinator.SetCoordinatorProxy(e.Proxy);
     e.StateMachine.ChangeState(base.state.States.CoordinatorVolatilePreparingRegistered);
 }
 public override void OnEvent(MsgRegisterVolatileResponseEvent e)
 {
 }
 public void OnEvent(MsgRegisterVolatileResponseEvent e)
 {
     DebugTrace.TxTrace(TraceLevel.Info, e.Enlistment.EnlistmentId, "{0} from {1}", e, Ports.TryGetAddress(e.VolatileCoordinator.Coordinator.RegistrationProxy));
 }