Пример #1
0
        private async Task <Engines.CollectionActionResult> RemoteExecuteAsync(
            IRemoteTargetActions handler,
            Uri sourceUrl,
            SelectionResult sourceSelectionResult,
            Uri targetUrl,
            DepthHeader depth,
            bool overwrite,
            CancellationToken cancellationToken)
        {
            Debug.Assert(sourceSelectionResult.Collection != null, "sourceSelectionResult.Collection != null");

            var parentCollectionUrl = targetUrl.GetParent();

            var engine = new RecursiveExecutionEngine <RemoteCollectionTarget, RemoteDocumentTarget, RemoteMissingTarget>(
                handler,
                overwrite,
                Logger);

            var targetName       = targetUrl.GetName();
            var parentName       = parentCollectionUrl.GetName();
            var parentCollection = new RemoteCollectionTarget(null, parentName, parentCollectionUrl, false, handler);
            var targetItem       = await handler.GetAsync(parentCollection, targetName, cancellationToken);

            return(await ExecuteAsync(
                       engine,
                       sourceUrl,
                       sourceSelectionResult,
                       parentCollection,
                       targetItem,
                       depth,
                       cancellationToken)
                   );
        }
Пример #2
0
 /// <inheritdoc />
 public Task <ITarget> GetAsync(string name, CancellationToken cancellationToken)
 {
     return(_targetActions.GetAsync(this, name, cancellationToken));
 }