Exemplo n.º 1
0
 public DataSyncSettingAction(IocManager _iocManager,
                              IFormIOSchemeManager _formIOSchemeManager,
                              IDataSyncSettingsManager _dataSyncSettingManager
                              )
 {
     iocManager              = _iocManager;
     formIOSchemeManager     = _formIOSchemeManager;
     dataSyncSettingsManager = _dataSyncSettingManager;
     Logger = NullLogger.Instance;
 }
 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;
 }
Exemplo n.º 3
0
        public static void DataSyncSettingClick(IocManager iocManager, IFormIOSchemeManager formIOSchemeManager, IDataSyncSettingsManager dataSyncSettingManager, ILogger logger)
        {
            DialogHybirdForm <FormIOControl> dialog = new DialogHybirdForm <FormIOControl>(iocManager, typeof(ZtgeoGisHybridMoudle).Assembly, new string[] {
                "WebViews", "FormIO", "FormIoWebView.html"
            });

            dialog.Size            = new Size(1260, 760);
            dialog.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            dialog.StartPosition   = FormStartPosition.CenterScreen;
            string component = formIOSchemeManager.GetFormIOSchemeById(1);
            string data      = dataSyncSettingManager.GetDataSyncSettings();

            ((FormIOControl)dialog.hybridControl).SetFormIOComponentAndData(component, data);
            ((FormIOControl)dialog.hybridControl).OnSave = (control, submissionData) => {
                try
                {
                    dynamic subdata = JsonConvert.DeserializeObject <dynamic>(submissionData);
                    dataSyncSettingManager.SetDataSyncSettings(subdata);
                }
                catch (Exception ex) {
                    EventBus.Default.Trigger(new NonUIExceptionEventData {
                        UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false)
                    });
                }
            };
            dialog.ShowDialog();
        }