public override bool Apply(bool disposeController)
        {
            bool result;

            result = _commonImportOptionsController.Apply(false);
            if (!result)
            {
                return(result);
            }
            else
            {
                _doc.ImportOptions = (Altaxo.Data.IDataSourceImportOptions)_commonImportOptionsController.ModelObject;
            }

            result = _specificImportOptionsController.Apply(false);
            if (!result)
            {
                Current.Gui.ErrorMessageBox("Error in script. Please edit the script to remove the error");
                return(result);
            }
            else
            {
                _doc.ImportScript = (FileImportScript)_specificImportOptionsController.ModelObject; // AsciiImportOptions is cloned in property set
            }
            result = _specificImportSourceController.Apply(false);
            if (!result)
            {
                return(result);
            }
            else
            {
                _doc.SourceFileNames = (IEnumerable <string>)_specificImportSourceController.ModelObject; // AsciiImportOptions is cloned in property set
            }
            if (disposeController)
            {
                _commonImportOptionsController.Dispose();
                _specificImportOptionsController.Dispose();
                _specificImportSourceController.Dispose();
            }

            SuccessfullyApplied?.Invoke();

            return(ApplyEnd(true, disposeController));
        }
Exemplo n.º 2
0
        public override bool Apply(bool disposeController)
        {
            bool result;

            result = _commonImportOptionsController.Apply(false);
            if (!result)
            {
                return(result);
            }
            else
            {
                _doc.ImportOptions = (Altaxo.Data.IDataSourceImportOptions)_commonImportOptionsController.ModelObject;
            }

            result = _specificImportOptionsController.Apply(false);
            if (!result)
            {
                return(result);
            }
            else
            {
                _doc.AsciiImportOptions = (AsciiImportOptions)_specificImportOptionsController.ModelObject; // AsciiImportOptions is cloned in property set
            }
            result = _specificImportSourceController.Apply(false);
            if (!result)
            {
                return(result);
            }
            else
            {
                _doc.SourceFileNames = (IEnumerable <string>)_specificImportSourceController.ModelObject; // AsciiImportOptions is cloned in property set
            }
            if (disposeController)
            {
                _commonImportOptionsController.Dispose();
                _specificImportOptionsController.Dispose();
                _specificImportSourceController.Dispose();
            }

            SuccessfullyApplied?.Invoke();
            return(ApplyEnd(true, disposeController));
        }