/// <summary>
        /// inserts the entry asynchronous, you need to supply a valid and unique
        /// token. Events will be send to the async delegates you setup on the service
        /// object
        /// </summary>
        /// <param name="feedUri">the target feed the entry get's inserted into</param>
        /// <param name="entry"></param>
        /// <param name="userData">a unique identifier to associate this request with</param>
        /// <returns></returns>
        public void InsertAsync(Uri feedUri, AtomEntry entry, Object userData)
        {
            AsyncSendData          data           = new AsyncSendData(this, feedUri, entry, ProgressReportDelegate, userData);
            WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncInsertWorker);

            AsyncStarter(data, workerDelegate, userData);
        }
        /// <summary>
        /// takes a given feed, and does a batch post of that feed
        /// against the batchUri parameter. If that one is NULL
        /// it will try to use the batch link URI in the feed
        /// </summary>
        /// <param name="feed">the feed to post</param>
        /// <param name="batchUri">the URI to user</param>
        /// <param name="userData">the userdata identifying this request</param>
        /// <returns></returns>
        public void BatchAsync(AtomFeed feed, Uri batchUri, Object userData)
        {
            AsyncSendData          data           = new AsyncSendData(this, batchUri, feed, ProgressReportDelegate, userData);
            WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncBatchWorker);

            AsyncStarter(data, workerDelegate, userData);
        }
        /// <summary>
        /// updates the entry asynchronous, you need to supply a valid and unique
        /// token. Events will be send to the async delegates you setup on the service
        /// object
        /// </summary>
        /// <param name="entry"></param>
        /// <param name="userData">a unique identifier to associate this request with</param>
        /// <returns></returns>
        public void UpdateAsync(AtomEntry entry, Object userData)
        {
            AsyncSendData          data           = new AsyncSendData(this, entry, ProgressReportDelegate, userData);
            WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncUpdateWorker);

            AsyncStarter(data, workerDelegate, userData);
        }
        /// <summary>
        /// this is a helper function for to send binary data asyncronous to a resource
        /// </summary>
        /// <param name="targetUri"></param>
        /// <param name="inputStream"></param>
        /// <param name="type"></param>
        /// <param name="contentType">the contenttype to use in the request, if NULL is passed, factory default is used</param>
        /// <param name="slugHeader">the slugHeader to use in the request, if NULL is passed, factory default is used</param>
        /// <param name="userData">a unique identifier to associate this request with</param>
        /// <param name="parseFeed">indicates if the async operation should try to parse the server returned stream, or just return the stream</param>
        /// <returns></returns>
        private void StreamSendAsync(Uri targetUri,
                                     Stream inputStream,
                                     GDataRequestType type,
                                     string contentType,
                                     string slugHeader,
                                     object userData, bool parseFeed)
        {
            AsyncSendData data = new AsyncSendData(this, targetUri, inputStream, type, contentType, slugHeader,
                                                   this.ProgressReportDelegate, userData, parseFeed);
            WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncStreamSendWorker);

            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(AsyncSendData data, WorkerSendEventHandler workerDelegate, Object userData)
        {
            AsyncOperation asyncOp = AsyncOperationManager.CreateOperation(userData);

            data.Operation = asyncOp;

            AddUserDataToDictionary(userData, asyncOp);

            // Start the asynchronous operation.
            workerDelegate.BeginInvoke(
                data,
                asyncOp,
                CompletionMethodDelegate,
                null,
                null);
        }
Exemplo n.º 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(AsyncSendData data, WorkerSendEventHandler 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);
        }
Exemplo n.º 7
0
 /// <summary>
 /// this is a helper function for to send binary data asyncronous to a resource
 /// </summary>
 /// <param name="targetUri"></param>
 /// <param name="inputStream"></param>
 /// <param name="type"></param>
 /// <param name="contentType">the contenttype to use in the request, if NULL is passed, factory default is used</param>
 /// <param name="slugHeader">the slugHeader to use in the request, if NULL is passed, factory default is used</param>
 /// <param name="userData">a unique identifier to associate this request with</param>
 /// <param name="parseFeed">indicates if the async operation should try to parse the server returned stream, or just return the stream</param>
 /// <returns></returns>
 private void StreamSendAsync(Uri targetUri,
     Stream inputStream,
     GDataRequestType type,
     string contentType,
     string slugHeader,
     object userData,
     bool parseFeed) {
     AsyncSendData data = new AsyncSendData(this, targetUri, inputStream, type, contentType, slugHeader,
         this.ProgressReportDelegate, userData, parseFeed);
     WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncStreamSendWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }
Exemplo n.º 8
0
 /// <summary>
 /// takes a given feed, and does a batch post of that feed
 /// against the batchUri parameter. If that one is NULL 
 /// it will try to use the batch link URI in the feed
 /// </summary>
 /// <param name="feed">the feed to post</param>
 /// <param name="batchUri">the URI to user</param>
 /// <param name="userData">the userdata identifying this request</param>
 /// <returns></returns>
 public void BatchAsync(AtomFeed feed, Uri batchUri, Object userData) {
     AsyncSendData data = new AsyncSendData(this, batchUri, feed, this.ProgressReportDelegate, userData);
     WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncBatchWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }
Exemplo n.º 9
0
 /// <summary>
 /// inserts the entry asynchronous, you need to supply a valid and unique
 /// token. Events will be send to the async delegates you setup on the service
 /// object
 /// </summary>
 /// <param name="feedUri">the target feed the entry get's inserted into</param>
 /// <param name="entry"></param>
 /// <param name="userData">a unique identifier to associate this request with</param>
 /// <returns></returns>
 public void InsertAsync(Uri feedUri, AtomEntry entry, Object userData) {
     AsyncSendData data = new AsyncSendData(this, feedUri, entry, this.ProgressReportDelegate, userData);
     WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncInsertWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }
Exemplo n.º 10
0
 /// <summary>
 /// updates the entry asynchronous, you need to supply a valid and unique
 /// token. Events will be send to the async delegates you setup on the service
 /// object
 /// </summary>
 /// <param name="entry"></param>
 /// <param name="userData">a unique identifier to associate this request with</param>
 /// <returns></returns>
 public void UpdateAsync(AtomEntry entry, Object userData) {
     AsyncSendData data = new AsyncSendData(this, entry, this.ProgressReportDelegate, userData);
     WorkerSendEventHandler workerDelegate = new WorkerSendEventHandler(AsyncUpdateWorker);
     this.AsyncStarter(data, workerDelegate, userData);
 }