samihadas / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

No Delete Async support #342

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I was looking around async operations, and saw there was no asyncdelete. Up 
until now I was using BatchAsync to delete documents, but I needed something 
that can handle permanent deletion, so I added the "DeleteAsync" method to 
the Service class, along with some other needed methods, and also added the 
permenantDelete flag on the base delete method.

Hope you find this patch useful enough to add it into your code.

Original issue reported on code.google.com by ATGard...@gmail.com on 24 Feb 2010 at 6:03

Attachments:

GoogleCodeExporter commented 8 years ago
Appreciated and checked in

Original comment by fman...@gmail.com on 26 May 2010 at 8:26

GoogleCodeExporter commented 8 years ago
Thanks for checking it in.
Is there a reason for not including the change to 
AsyncOperationCompletedEventArgs 
constructor (reading the deleted entry from the data) so that the completion 
handler 
can see which entry was just removed?

Original comment by ATGard...@gmail.com on 26 May 2010 at 9:57

GoogleCodeExporter commented 8 years ago
Hmm... merge conflict? I did not see that change when i applied the merge. Can 
you send me just that change ? 

my fault for letting this hang there for so long...

Original comment by fman...@gmail.com on 26 May 2010 at 12:20

GoogleCodeExporter commented 8 years ago
I also changed the constructor to public, so I can create these EventArgs for 
my own needs as well..
But the main change is in the AsyncDeleteData section there

        public AsyncOperationCompletedEventArgs(AsyncData data)
            : base(data.Exception, false, data.UserData)
        {
            feedObject = data.Feed;
            stream = data.DataStream;

            AsyncSendData sData = data as AsyncSendData;
            if (sData != null)
            {
                entryObject = sData.Entry;
            }

            AsyncDeleteData dData = data as AsyncDeleteData;
            if (dData != null)
            {
                entryObject = dData.Entry;
            }
        }

Original comment by ATGard...@gmail.com on 26 May 2010 at 12:59