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); }
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); }
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); }
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); }
/// <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); }