Esempio n. 1
0
        public virtual void ExportFolder(Folder folder, string targetPath, bool recursive)
        {
            if (folder == null)
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (targetPath == null)
            {
                throw new ArgumentNullException(nameof(targetPath));
            }

            if (!LongPath.DirectoryExists(targetPath))
            {
                throw new ArgumentException("Invalid path.", nameof(targetPath));
            }

            _errorMessages.Clear();
            ExportFolderContent(folder, targetPath, recursive);
        }
Esempio n. 2
0
        public virtual void ExportList(List list, string targetPath)
        {
            if (list == null)
            {
                throw new ArgumentNullException(nameof(list));
            }

            if (targetPath == null)
            {
                throw new ArgumentNullException(nameof(targetPath));
            }

            if (!LongPath.DirectoryExists(targetPath))
            {
                throw new ArgumentException("Invalid path.", nameof(targetPath));
            }

            _errorMessages.Clear();
            string listPath;

            WriteList(list, targetPath, out listPath);
        }
Esempio n. 3
0
        public bool ExportTo(string targetPath)
        {
            if (targetPath == null)
            {
                throw new ArgumentNullException(nameof(targetPath));
            }

            if (!LongPath.DirectoryExists(targetPath))
            {
                throw new ArgumentException("Invalid path.", nameof(targetPath));
            }

            _folder.Server.ShowMessageBoxOnError = false;
            try
            {
                DataExporter.ExportFolder(_folder, targetPath, true);
            }
            finally
            {
                _folder.Server.ShowMessageBoxOnError = true;
            }
            return(DataExporter.ErrorMessages.Count == 0);
        }