private void MsgClient_OnException(Exception ExceptionData)
 {
     this.diagnostic.Throw((Enum)InterbusHandlingState.MessageClientDiagnostic, new byte[0], ExceptionData);
     this.diagnostic.Quit();
     this.activeFirmwareService = (FirmwareService)null;
     this.firmwareServiceList.DeleteAll();
 }
 private void UpdateFirmwareService()
 {
     if (this.activeFirmwareService != null)
     {
         if (this.activeFirmwareService.ActualState == FirmwareService.State.Done)
         {
             this.activeFirmwareService = this.firmwareServiceList.GetNextFirmwareService();
         }
         else if (this.activeFirmwareService.ActualState == FirmwareService.State.Error)
         {
             this.firmwareServiceList.DeleteAll();
             this.activeFirmwareService = (FirmwareService)null;
             return;
         }
         this.ExecuteService();
     }
     else
     {
         if (this.firmwareServiceList.Count <= 0)
         {
             return;
         }
         this.activeFirmwareService = this.firmwareServiceList.GetNextFirmwareService();
     }
 }
 internal void ResetFirmwareService()
 {
     this.firmwareServiceList.DeleteAll();
     this.activeFirmwareService = (FirmwareService)null;
     this.msgClient.ClearSendData();
     this.msgClient.ClearReceiveData();
     this.HandlingState = InterbusHandlingState.Idle;
 }
 internal void Enable()
 {
     if (this.enable)
     {
         return;
     }
     this.diagnostic.Enable();
     this.activeFirmwareService = (FirmwareService)null;
     this.firmwareServiceList.DeleteAll();
     this.enable = true;
 }
 internal FirmwareService GetNextFirmwareService()
 {
     lock (this.accessLock)
     {
         if (this.firmwareServiceList.Count <= 0)
         {
             return((FirmwareService)null);
         }
         FirmwareService firmwareService = this.firmwareServiceList[0].Clone() as FirmwareService;
         this.firmwareServiceList.RemoveAt(0);
         return(firmwareService);
     }
 }
 internal InterbusHandling(string name)
 {
     this.name                   = name.Length != 0 ? "InterbusHandling " + name : nameof(InterbusHandling);
     this.diagnostic             = new Diagnostic(this.Name);
     this.msgClient              = new MessageClient(this.Name);
     this.msgClient.Timeout      = 5;
     this.msgClient.OnException += new ExceptionHandler(this.MsgClient_OnException);
     this.HandlingState          = InterbusHandlingState.Idle;
     this.RevisionInfo           = new RevisionInformation();
     this.FirmwareSercivePositiveConfirmationReceived += new ConfirmationReceiveHandler(this.OnPDCycleTimeHandler);
     this.FirmwareSercivePositiveConfirmationReceived += new ConfirmationReceiveHandler(this.OnGetVersionInfoHandler);
     this.activeFirmwareService = (FirmwareService)null;
 }
 internal void AddFirmwareService(FirmwareService service)
 {
     lock (this.accessLock)
     {
         if (service == null)
         {
             return;
         }
         this.firmwareServiceList.Add(service);
         if (Count >= 4)
         {
             foreach (var i in firmwareServiceList)
             {
                 Trace.WriteLine(i.ToString());
             }
         }
     }
 }