/******************************************************************************* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * ***************************************************************************** * __ _ _ ___ * ( )( \/\/ )/ __) * /__\ \ / \__ \ * (_)(_) \/\/ (___/ * * AWS SDK for .NET * API Version: 2006-03-01 * */ using System; using System.Collections.Generic; using System.Text; using Amazon.S3.Model; using Amazon.Util; namespace Amazon.S3.Transfer { /// /// Contains all the parameters /// that can be set when making a this request with the /// TransferUtility method. /// public partial class TransferUtilityDownloadRequest : BaseDownloadRequest { /// /// Get or sets the file path location of where the /// downloaded Amazon S3 object will be written to. /// /// /// The file path location of where the downloaded Amazon S3 object will be written to. /// public string FilePath { get; set; } /// /// Checks if FilePath property is set. /// /// True if FilePath property is set. internal bool IsSetFilePath() { return !System.String.IsNullOrEmpty(this.FilePath); } /// /// The event for WriteObjectProgressEvent notifications. All /// subscribers will be notified when a new progress /// event is raised. /// /// The WriteObjectProgressEvent is fired as data /// is downloaded from S3. The delegates attached to the event /// will be passed information detailing how much data /// has been downloaded as well as how much will be downloaded. /// /// /// /// Subscribe to this event if you want to receive /// WriteObjectProgressEvent notifications. Here is how:
/// 1. Define a method with a signature similar to this one: /// /// private void displayProgress(object sender, WriteObjectProgressArgs args) /// { /// Console.WriteLine(args); /// } /// /// 2. Add this method to the WriteObjectProgressEvent delegate's invocation list /// /// TransferUtilityDownloadRequest request = new TransferUtilityDownloadRequest(); /// request.WriteObjectProgressEvent += displayProgress; /// ///
public event EventHandler WriteObjectProgressEvent; /// /// Causes the WriteObjectProgressEvent event to be fired. /// /// Progress data for the stream being written to file. internal void OnRaiseProgressEvent(WriteObjectProgressArgs progressArgs) { AWSSDKUtils.InvokeInBackground(WriteObjectProgressEvent, progressArgs, this); } } }