Exemplo n.º 1
0
        void connectToEvernote()
        {
            Console.WriteLine("Connecting to Evernote...");
            try {
                ENSession.SetSharedSessionDeveloperToken("S=s1:U=900da:E=151ab755e3b:C=14a53c43030:P=1cd:A=en-devtoken:V=2:H=a26c9a039a23f8a387534810682c5d7f",
                                                         "https://evernote.com/shard/s1/notestore");
                if (!ENSession.SharedSession.IsAuthenticated)
                {
                    ENSession.SharedSession.AuthenticateToEvernote();
                    Console.WriteLine("Got EN Connection");
                }
                else
                {
                    Console.WriteLine("Authenticated");
                }
            } catch (Exception e) {
                Console.WriteLine(e.Message);
            }

            List <ENSessionFindNotesResult> myNotesList = ENSession.SharedSession.FindNotes(ENNoteSearch.NoteSearch("tag:книга tag:"),
                                                                                            null, ENSession.SearchScope.All,
                                                                                            ENSession.SortOrder.RecentlyUpdated, 20);

            if (myNotesList.Count > 0)
            {
                foreach (ENSessionFindNotesResult result in myNotesList)
                {
                    // Each ENSessionFindNotesResult has a noteRef along with other important metadata.
                    Console.WriteLine("Found note with title: " + result.Title);
                }
            }
        }
        private string GetUserInfos(AccessToken accessToken)
        {
            ENSession.SetSharedSessionDeveloperToken(accessToken.Token, accessToken.NoteStoreUrl);
            var session = new ENSession();

            session.PerformPostAuthentication();
            return(session.UserDisplayName);
        }
 public void SetSharedSessionDeveloperToken(string sessionDeveloperToken, string sessionNoteStoreUrl)
 {
     ENSession.SetSharedSessionDeveloperToken(sessionDeveloperToken, sessionNoteStoreUrl);
 }
Exemplo n.º 4
0
 new public static void SetSharedSessionDeveloperToken(string sessionDeveloperToken, string sessionNoteStoreUrl)
 {
     ENSession.ENSessionInterfaceType = InterfaceType.Advanced;
     ENSession.SetSharedSessionDeveloperToken(sessionDeveloperToken, sessionNoteStoreUrl);
 }
Exemplo n.º 5
0
 private void Form1_Load(object sender, EventArgs e)
 {
     ENSession.SetSharedSessionDeveloperToken(Properties.Resources.ResourceManager.GetString("Token"),
                                              Properties.Resources.ResourceManager.GetString("StoreUrl"));
 }