private User GetUser(UserStore.Client userStore, string authToken) { try { return(userStore.getUser(authToken)); } catch (Exception ex) { throw new EverpageException( String.Format("Error occurred when getting user by authentication token '{0}': {1}", authToken, ex.Message), ex); } }
/// <summary> /// Evernoteのユーザー名を取得する /// </summary> /// <param name="EvernoteToken">Evernoteトークン</param> /// <returns>ユーザー名</returns> static public string GetEvernoteUserName(string EvernoteToken) { string authToken = EvernoteToken; Uri userStoreUrl = new Uri("https://" + evernoteHost + "/edam/user"); TTransport userStoreTransport = new THttpClient(userStoreUrl); TProtocol userStoreProtocol = new TBinaryProtocol(userStoreTransport); UserStore.Client userStore = new UserStore.Client(userStoreProtocol); return(userStore.getUser(authToken).Username); }
public User Get(string authToken) { return(_Instance.getUser(authToken)); }