Exemplo n.º 1
0
        void IScannerInteractionChannel.ResetSoft(
            ResetSoftReason reason, bool isRemoteScannerInitiator, bool needRestartApp)
        {
            var resetSoftParams = new ResetSoftParams(reason, isRemoteScannerInitiator, needRestartApp);

            if (isRemoteScannerInitiator)
            {
                ThreadUtils.StartBackgroundThread(ResetSoftInternal, resetSoftParams);
            }
            else
            {
                ResetSoftInternal(resetSoftParams);
            }
        }
Exemplo n.º 2
0
        private string GetArchivePrefix(ResetSoftParams resetSoftParams)
        {
            var electionMode = ElectionMode.Training;
            var electionDate = "xxxxxxxx";

            if (_electionManager.HasSourceData())
            {
                electionMode = _electionManager.SourceData.ElectionMode;
                electionDate = _electionManager.SourceData.ElectionDate.ToString("yyyyMMdd");
            }
            var    electionModeStr = (electionMode == ElectionMode.Real ? "real" : "train");
            string reasonStr;

            switch (resetSoftParams.Reason)
            {
            case ResetSoftReason.ElectionFinished:
                reasonStr = "el";
                break;

            case ResetSoftReason.ResetSoftFromSystemMenu:
                reasonStr = "rsm";
                break;

            case ResetSoftReason.ResetUikFromSystemMenu:
                reasonStr = "rum";
                break;

            case ResetSoftReason.ControlVotingStartTriggered:
                reasonStr = "cvs";
                break;

            case ResetSoftReason.ConflictDetected:
                reasonStr = "cnf";
                break;

            default:
                throw new ArgumentOutOfRangeException("resetSoftParams", "Неожиданная причина сброса ПО");
            }
            if (resetSoftParams.IsRemoteScannerInitiator)
            {
                reasonStr += "_rs";
            }
            return(string.Format("{{0:000000}}_{0}_{1}_{2}", electionModeStr, electionDate, reasonStr));
        }
Exemplo n.º 3
0
 private string GetArchivePrefix(ResetSoftParams resetSoftParams)
 {
     var electionMode = ElectionMode.Training;
     var electionDate = "xxxxxxxx";
     if (_electionManager.HasSourceData())
     {
         electionMode = _electionManager.SourceData.ElectionMode;
         electionDate = _electionManager.SourceData.ElectionDate.ToString("yyyyMMdd");
     }
     var electionModeStr = (electionMode == ElectionMode.Real ? "real" : "train");
     string reasonStr;
     switch (resetSoftParams.Reason)
     {
         case ResetSoftReason.ElectionFinished:
             reasonStr = "el";
             break;
         case ResetSoftReason.ResetSoftFromSystemMenu:
             reasonStr = "rsm";
             break;
         case ResetSoftReason.ResetUikFromSystemMenu:
             reasonStr = "rum";
             break;
         case ResetSoftReason.ControlVotingStartTriggered:
             reasonStr = "cvs";
             break;
         case ResetSoftReason.ConflictDetected:
             reasonStr = "cnf";
             break;
         default:
             throw new ArgumentOutOfRangeException("resetSoftParams", "Неожиданная причина сброса ПО");
     }
     if (resetSoftParams.IsRemoteScannerInitiator)
         reasonStr += "_rs";
     return string.Format("{{0:000000}}_{0}_{1}_{2}", electionModeStr, electionDate, reasonStr);
 }
Exemplo n.º 4
0
 void IScannerInteractionChannel.ResetSoft( 
     ResetSoftReason reason, bool isRemoteScannerInitiator, bool needRestartApp)
 {
     var resetSoftParams = new ResetSoftParams(reason, isRemoteScannerInitiator, needRestartApp);
     if (isRemoteScannerInitiator)
         ThreadUtils.StartBackgroundThread(ResetSoftInternal, resetSoftParams);
     else
         ResetSoftInternal(resetSoftParams);
 }