internal List <Entity.Notebook> ReadEvernoteNotes(String edamBaseUrl, AuthenticationResult authResult) { string authToken = authResult.AuthenticationToken; NoteStore.Client noteStore = EvernoteHelper.GetNoteStoreClient(edamBaseUrl, authResult.User); List <Notebook> notebooks = noteStore.listNotebooks(authToken); int nbCount = 1; foreach (Entity.Notebook enNotebook in enNotebooks) { int intProgress = Helper.GetNotebookProgress(nbCount++, enNotebooks.Count, 20, 60); UpdateProgress(intProgress); NoteFilter nf = new NoteFilter(); nf.NotebookGuid = enNotebook.Guid; NoteList nl = noteStore.findNotes(authToken, nf, 0, 500);//500 notes limit per notebook foreach (Note note in nl.Notes) { UpdateProgress(intProgress, "Retrieving " + enNotebook.Name + ", " + note.Title); Entity.Note enNote = new Entity.Note(); enNote.Title = note.Title; enNote.ShortDateString = note.Updated.ToString(); string enmlContent = noteStore.getNoteContent(authToken, note.Guid); enNote.LoadXml(enmlContent); if (enNotebook.Notes == null) { enNotebook.Notes = new List <Entity.Note>(); } enNotebook.Notes.Add(enNote); } } enNotebooks.Sort(delegate(Entity.Notebook p1, Entity.Notebook p2) { return(p1.Name.CompareTo(p2.Name)); }); return(enNotebooks); }
internal List<Entity.Notebook> ReadEvernoteNotes(String edamBaseUrl, AuthenticationResult authResult) { string authToken = authResult.AuthenticationToken; NoteStore.Client noteStore = EvernoteHelper.GetNoteStoreClient(edamBaseUrl, authResult.User); List<Notebook> notebooks = noteStore.listNotebooks(authToken); int nbCount=1; foreach (Entity.Notebook enNotebook in enNotebooks) { int intProgress = Helper.GetNotebookProgress(nbCount++, enNotebooks.Count, 20, 60); UpdateProgress(intProgress); NoteFilter nf = new NoteFilter(); nf.NotebookGuid = enNotebook.Guid; NoteList nl = noteStore.findNotes(authToken, nf, 0, 500);//500 notes limit per notebook foreach (Note note in nl.Notes) { UpdateProgress(intProgress, "Retrieving " + enNotebook.Name + ", " + note.Title); Entity.Note enNote = new Entity.Note(); enNote.Title = note.Title; enNote.ShortDateString = note.Updated.ToString(); string enmlContent = noteStore.getNoteContent(authToken, note.Guid); enNote.LoadXml(enmlContent); if (enNotebook.Notes == null) enNotebook.Notes = new List<Entity.Note>(); enNotebook.Notes.Add(enNote); } } enNotebooks.Sort(delegate(Entity.Notebook p1, Entity.Notebook p2) { return p1.Name.CompareTo(p2.Name); }); return enNotebooks; }