public DataSyncMenuProvider(IocManager _iocManager,
                             IFormIOSchemeManager _formIOSchemeManager,
                             IDataSyncSettingsManager _dataSyncSettingManager,
                             DataSyncOperator _dataSyncOperator,
                             DataCapture _dataCapture,
                             TriggerOperation _triggerOperation
                             )
 {
     iocManager             = _iocManager;
     formIOSchemeManager    = _formIOSchemeManager;
     dataSyncSettingManager = _dataSyncSettingManager;
     dataSyncOperator       = _dataSyncOperator;
     dataCapture            = _dataCapture;
     triggerOperation       = _triggerOperation;
     Logger = NullLogger.Instance;
 }
Ejemplo n.º 2
0
 public static void DataSyncOperationClick(IocManager iocManager, DataSyncDirection dataSyncDirection, DataCapture dataCapture, DataSyncOperator dataSyncOperator, ILogger logger)
 {
     try
     {
         DataSyncConfig config = GetDataSyncConfig();
         if (config != null)
         {
             WaitDialogForm sdf = new WaitDialogForm("提示", "正在同步数据......");
             dataSyncOperator.SyncData(config, dataSyncDirection);
             dataCapture.CaptureDirtyFromDBAndSave(config, dataSyncDirection);
             MessageBox.Show(dataSyncDirection == DataSyncDirection.InnerDataSync? "内网数据同步完成" : "外网数据同步完成");
             sdf.Close();
         }
         else
         {
             logger.Warn("未找到数据同步的配置。/DataOperation/DataCaptureConfig.json");
         }
     }
     catch (Exception ex) {
         EventBus.Default.Trigger(new NonUIExceptionEventData {
             UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false)
         });
     }
 }
 public DataSysncMenuAction(IocManager _iocManager, DataCapture _dataCapture, DataSyncOperator _dataSyncOperator)
 {
     iocManager       = _iocManager;
     dataCapture      = _dataCapture;
     dataSyncOperator = _dataSyncOperator;
 }