Beispiel #1
0
        protected override void BeginProcessing()
        {
            base.BeginProcessing();

            this.TransferManager       = TransferManagerFactory.CreateTransferManager(this.GetCmdletConcurrency());
            OutputStream.ConfirmWriter = (target, query, caption) => ShouldContinue(query, caption);
        }
Beispiel #2
0
        /// <summary>
        /// Cmdlet begin processing
        /// </summary>
        protected override void BeginProcessing()
        {
            base.BeginProcessing();
            OutputStream.ConfirmWriter = (s1, s2, s3) => ShouldContinue(s2, s3);

            this.TransferManager = TransferManagerFactory.CreateTransferManager(this.GetCmdletConcurrency());
        }
Beispiel #3
0
        private void DownloadFileInternal(string shareName, string fileName, string destination, Action downloadFileAction)
        {
            var mockupTransferManager = new DownloadTransferManager(
                (sourceFile, destPath) =>
            {
                Assert.AreEqual(destination, destPath, "Destination validation failed.");
                Assert.AreEqual(shareName, sourceFile.Share.Name, "Share validation failed.");
                Assert.AreEqual(fileName, sourceFile.Name, "SourceFile validation failed.");
            });

            TransferManagerFactory.SetCachedTransferManager(mockupTransferManager);

            downloadFileAction();

            mockupTransferManager.ThrowAssertExceptionIfAvailable();
            this.MockCmdRunTime.OutputPipeline.AssertNoObject();
        }
        private void UploadFileInternal(string shareName, string sourceFilePath, string destinationFileName, Action uploadFileAction)
        {
            var mockupTransferManager = new UploadTransferManager(
                (sourcePath, destFile) =>
            {
                Assert.AreEqual(destinationFileName, destFile.Name, "Destination file name validation failed.");
                Assert.AreEqual(shareName, destFile.Share.Name, "Share validation failed.");
                Assert.AreEqual(sourceFilePath, sourcePath, "Source file validation failed.");
            });

            TransferManagerFactory.SetCachedTransferManager(mockupTransferManager);

            uploadFileAction();

            mockupTransferManager.ThrowAssertExceptionIfAvailable();
            this.MockCmdRunTime.OutputPipeline.AssertNoObject();
            this.MockCmdRunTime.ErrorStream.AssertNoObject();
        }
        protected virtual void DoBeginProcessing()
        {
            CmdletOperationContext.Init();
            CmdletCancellationToken = _cancellationTokenSource.Token;
            WriteDebugLog(String.Format(Resources.InitOperationContextLog, GetType().Name, CmdletOperationContext.ClientRequestId));

            if (_enableMultiThread)
            {
                SetUpMultiThreadEnvironment();
            }

            OpContext.GlobalSendingRequest +=
                (sender, args) =>
            {
                //https://github.com/Azure/azure-storage-net/issues/658
            };

            OutputStream.ConfirmWriter = (s1, s2, s3) => ShouldContinue(s2, s3);

            this.TransferManager = TransferManagerFactory.CreateTransferManager(this.GetCmdletConcurrency());
        }
        /// <summary>
        /// Cmdlet begin processing
        /// </summary>
        protected override void BeginProcessing()
        {
            base.BeginProcessing();

            this.TransferManager = TransferManagerFactory.CreateTransferManager(this.GetCmdletConcurrency());
        }