Ejemplo n.º 1
0
        public static void GetMyNotes(String bookID, bool lastItem)
        {
            try
            {
                List <Note>      noteList = null;
                BackgroundWorker worker   = new BackgroundWorker();
                worker.DoWork += delegate
                {
                    SaveMyStuff_2 webService = new SaveMyStuff_2(Server.GenerateContentSyncURL(Settings.ServerURL));
                    if (Settings.UseFormsAuth)
                    {
                        webService.CookieContainer = Authenticate.GetCookieContainer();
                    }
                    else
                    {
                        webService.Credentials = KeychainAccessor.NetworkCredential;
                    }
                    TextAnnotationObj[] results = webService.GetMyTextAnnotations(bookID);

                    if (results != null && results.Length > 0)
                    {
                        noteList = new List <Note>();
                        foreach (TextAnnotationObj ta in results)
                        {
                            Note note = GenerateNote(ta);
                            noteList.Add(note);
                        }
                    }
                };
                worker.RunWorkerCompleted += delegate
                {
                    if (GetMyNotesEvent != null)
                    {
                        GetMyNotesEvent(bookID, noteList, lastItem);
                    }
                };
                worker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                Logger.WriteLineDebugging("SaveMyStuff - GetMyNotes: {0}", ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public static TextAnnotationObj[] GetMyNotesFromCloud(String bookID)
        {
            SaveMyStuff_2 client = GenerateSaveMyStuffClient();

            return(client.GetMyTextAnnotations(bookID));
        }