コード例 #1
0
        public void UpdateAsync(Authenticator authentication, AbstractEntry payload, object userData)
        {
            AsyncResumableUploadData data = new AsyncResumableUploadData(this,
                                                                         authentication,
                                                                         payload,
                                                                         HttpMethods.Put,
                                                                         this.ProgressReportDelegate,
                                                                         userData);
            WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncUpdateWorker);

            this.AsyncStarter(data, workerDelegate, userData);
        }
コード例 #2
0
        public void InsertAsync(Authenticator authentication, AbstractEntry payload, object userData)
        {
            AsyncResumableUploadData data = new AsyncResumableUploadData(this,
                                                                         authentication,
                                                                         payload,
                                                                         HttpMethods.Post,
                                                                         this.ProgressReportDelegate,
                                                                         userData);

            data.UriToUse = GetResumableCreateUri(payload.Links);
            WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncInsertWorker);

            this.AsyncStarter(data, workerDelegate, userData);
        }
コード例 #3
0
        public void ResumeAsync(Authenticator authentication, Uri resumeUri, String httpmethod, Stream payload, string contentType, object userData)
        {
            AsyncResumableUploadData data = new AsyncResumableUploadData(this,
                                                                         authentication,
                                                                         resumeUri,
                                                                         payload,
                                                                         contentType,
                                                                         null,
                                                                         httpmethod,
                                                                         this.ProgressReportDelegate,
                                                                         userData);
            WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncResumeWorker);

            this.AsyncStarter(data, workerDelegate, userData);
        }
コード例 #4
0
        public void InsertAsync(Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug, object userData)
        {
            AsyncResumableUploadData data = new AsyncResumableUploadData(this,
                                                                         authentication,
                                                                         resumableUploadUri,
                                                                         payload,
                                                                         contentType,
                                                                         slug,
                                                                         HttpMethods.Post,
                                                                         this.ProgressReportDelegate,
                                                                         userData);
            WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncInsertWorker);

            this.AsyncStarter(data, workerDelegate, userData);
        }
コード例 #5
0
        /// <summary>
        /// starts the async job
        /// </summary>
        /// <param name="data"></param>
        /// <param name="userData"></param>
        /// <param name="workerDelegate"></param>
        /// <returns></returns>
        private void AsyncStarter(AsyncResumableUploadData data, WorkerResumableUploadHandler workerDelegate, Object userData)
        {
            AsyncOperation asyncOp = AsyncOperationManager.CreateOperation(userData);

            data.Operation = asyncOp;

            AddUserDataToDictionary(userData, asyncOp);

            // Start the asynchronous operation.
            workerDelegate.BeginInvoke(
                data,
                asyncOp,
                this.CompletionMethodDelegate,
                null,
                null);
        }
コード例 #6
0
        /// <summary>
        /// starts the async job
        /// </summary>
        /// <param name="data"></param>
        /// <param name="userData"></param>
        /// <param name="workerDelegate"></param>
        /// <returns></returns>
        private void AsyncStarter(AsyncResumableUploadData data, WorkerResumableUploadHandler workerDelegate, Object userData) {
            AsyncOperation asyncOp = AsyncOperationManager.CreateOperation(userData);
            data.Operation = asyncOp;

            AddUserDataToDictionary(userData, asyncOp);

            // Start the asynchronous operation.
            workerDelegate.BeginInvoke(
                data,
                asyncOp,
                this.CompletionMethodDelegate,
                null,
                null);
        }
コード例 #7
0
 public void ResumeAsync(Authenticator authentication, Uri resumeUri, String httpmethod, Stream payload, string contentType, object userData) {
     AsyncResumableUploadData data = new AsyncResumableUploadData(this,
         authentication,
         resumeUri,
         payload,
         contentType,
         null,
         httpmethod,
         this.ProgressReportDelegate,
         userData);
     WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncResumeWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }
コード例 #8
0
 public void UpdateAsync(Authenticator authentication, AbstractEntry payload, object userData) {
     AsyncResumableUploadData data = new AsyncResumableUploadData(this,
         authentication,
         payload,
         HttpMethods.Put,
         this.ProgressReportDelegate,
         userData);
     WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncUpdateWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }
コード例 #9
0
 public void InsertAsync(Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug, object userData) {
     AsyncResumableUploadData data = new AsyncResumableUploadData(this,
         authentication,
         resumableUploadUri,
         payload,
         contentType,
         slug,
         HttpMethods.Post,
         this.ProgressReportDelegate,
         userData);
     WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncInsertWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }
コード例 #10
0
 public void InsertAsync(Authenticator authentication, AbstractEntry payload, object userData) {
     AsyncResumableUploadData data = new AsyncResumableUploadData(this,
         authentication,
         payload,
         HttpMethods.Post,
         this.ProgressReportDelegate,
         userData);
     data.UriToUse = GetResumableCreateUri(payload.Links);
     WorkerResumableUploadHandler workerDelegate = new WorkerResumableUploadHandler(AsyncInsertWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }