/// <summary>
        /// Constructs a new BackgroundUploadEventAdapter injected with the given parameters.
        /// </summary>
        /// <param name="backgroundTransferService">The BackgroundTransferService used to Add and Remove requests on.</param>
        /// <param name="tcs">The TaskCompletionSource to set the result of the operation on.</param>
        public BackgroundDownloadEventAdapter(
            IBackgroundTransferService backgroundTransferService,
            TaskCompletionSource<LiveOperationResult> tcs)
        {
            Debug.Assert(backgroundTransferService != null);
            Debug.Assert(tcs != null);

            this.backgroundTransferService = backgroundTransferService;
            this.tcs = tcs;
        }
예제 #2
0
        /// <summary>
        /// Constructs a new BackgroundUploadCompletedEventAdapter injected with the given parameters.
        /// </summary>
        /// <param name="backgroundTransferService">The BackgroundTransferService used to Add and Remove requests on.</param>
        /// <param name="tcs">The TaskCompletionSource to set the result of the operation on.</param>
        public BackgroundUploadCompletedEventAdapter(
            IBackgroundTransferService backgroundTransferService,
            TaskCompletionSource <LiveOperationResult> tcs)
        {
            Debug.Assert(backgroundTransferService != null);
            Debug.Assert(tcs != null);

            this.backgroundTransferService = backgroundTransferService;
            this.tcs = tcs;
        }
예제 #3
0
        internal LivePendingDownload(
            IBackgroundTransferService backgroundTransferService,
            BackgroundTransferRequest request)
        {
            Debug.Assert(backgroundTransferService != null);
            Debug.Assert(request != null);
            Debug.Assert(BackgroundTransferHelper.IsDownloadRequest(request));

            this.request = request;
            this.backgroundTransferService = backgroundTransferService;
        }
        internal LivePendingDownload(
            IBackgroundTransferService backgroundTransferService, 
            BackgroundTransferRequest request)
        {
            Debug.Assert(backgroundTransferService != null);
            Debug.Assert(request != null);
            Debug.Assert(BackgroundTransferHelper.IsDownloadRequest(request));

            this.request = request;
            this.backgroundTransferService = backgroundTransferService;
        }
 private BackgroundDownloadOperation(Builder builder)
 {
     this.requestUri  = builder.RequestUri;
     this.accessToken = builder.AccessToken;
     this.downloadLocationOnDevice  = builder.DownloadLocationOnDevice;
     this.backgroundTransferService = builder.BackgroundTransferService;
     this.progress            = builder.Progress;
     this.tcs                 = new TaskCompletionSource <LiveOperationResult>();
     this.status              = OperationStatus.NotStarted;
     this.transferPreferences =
         BackgroundTransferHelper.GetTransferPreferences(builder.BackgroundTransferPreferences);
 }
 private BackgroundUploadOperation(Builder builder)
 {
     this.path = builder.Path;
     this.uploadLocationOnDevice = builder.UploadLocationOnDevice;
     this.client = builder.Client;
     this.backgroundTransferService = builder.BackgroundTransferService;
     this.overwriteOption           = builder.OverwriteOption;
     this.progress = builder.Progress;
     this.tcs      = new TaskCompletionSource <LiveOperationResult>();
     this.requestAddedToService = false;
     this.status = OperationStatus.NotStarted;
     this.transferPreferences =
         BackgroundTransferHelper.GetTransferPreferences(builder.BackgroundTransferPreferences);
 }
 public Builder()
 {
     this.backgroundTransferService = PhoneBackgroundTransferService.Instance;
 }
 public Builder()
 {
     this.backgroundTransferService = PhoneBackgroundTransferService.Instance;
 }
 private BackgroundDownloadOperation(Builder builder)
 {
     this.requestUri = builder.RequestUri;
     this.accessToken = builder.AccessToken;
     this.downloadLocationOnDevice = builder.DownloadLocationOnDevice;
     this.backgroundTransferService = builder.BackgroundTransferService;
     this.progress = builder.Progress;
     this.tcs = new TaskCompletionSource<LiveOperationResult>();
     this.status = OperationStatus.NotStarted;
     this.transferPreferences =
         BackgroundTransferHelper.GetTransferPreferences(builder.BackgroundTransferPreferences);
 }
 private BackgroundUploadOperation(Builder builder)
 {
     this.path = builder.Path;
     this.uploadLocationOnDevice = builder.UploadLocationOnDevice;
     this.client = builder.Client;
     this.backgroundTransferService = builder.BackgroundTransferService;
     this.overwriteOption = builder.OverwriteOption;
     this.progress = builder.Progress;
     this.tcs = new TaskCompletionSource<LiveOperationResult>();
     this.requestAddedToService = false;
     this.status = OperationStatus.NotStarted;
     this.transferPreferences =
         BackgroundTransferHelper.GetTransferPreferences(builder.BackgroundTransferPreferences);
 }