Beispiel #1
0
        public async Task <ReturnResult> CreateAsync(IStorageItemWithPath source, bool registerHistory)
        {
            FilesystemErrorCode            returnCode = FilesystemErrorCode.ERROR_INPROGRESS;
            Progress <FilesystemErrorCode> errorCode  = new Progress <FilesystemErrorCode>();

            errorCode.ProgressChanged += (s, e) => returnCode = e;

            IStorageHistory history = await filesystemOperations.CreateAsync(source, errorCode, cancellationToken);

            if (registerHistory && !string.IsNullOrWhiteSpace(source.Path))
            {
                App.HistoryWrapper.AddHistory(history);
            }

            return(returnCode.ToStatus());
        }
Beispiel #2
0
        public async Task <ReturnResult> RenameAsync(PathWithType source, string newName, NameCollisionOption collision, bool registerHistory)
        {
            FilesystemErrorCode            returnCode = FilesystemErrorCode.ERROR_INPROGRESS;
            Progress <FilesystemErrorCode> errorCode  = new Progress <FilesystemErrorCode>();

            errorCode.ProgressChanged += (s, e) => returnCode = e;

            IStorageHistory history = await filesystemOperations.RenameAsync(source, newName, collision, errorCode, cancellationToken);

            if (registerHistory && !string.IsNullOrWhiteSpace(source.Path))
            {
                App.HistoryWrapper.AddHistory(history);
            }

            return(returnCode.ToStatus());
        }