Пример #1
0
        public async Task<ArchiveResult> PerformArchive(string scanDirectory, string target)
        {
            if (_started)
                throw new InvalidOperationException("Archiver was already started");

            _started = true;

            _result = await Task.Run<ArchiveResult>(() => this.Archive(scanDirectory, target));
            return _result;
        }
Пример #2
0
        public async Task <ArchiveResult> PerformArchive(string scanDirectory, string target)
        {
            if (_started)
            {
                throw new InvalidOperationException("Archiver was already started");
            }

            _started = true;

            _result = await Task.Run <ArchiveResult>(() => this.Archive(scanDirectory, target));

            return(_result);
        }