void apnClientAuthProcess_AuthSuccess(object sender, AppNetDotNet.AuthorizationWindow.AuthEventArgs e) { if (e != null) { if (e.success) { account.accessToken = e.accessToken; if (account.verifyCredentials()) { Properties.Settings.Default.accessToken = account.accessToken; openMainWindow(); return; } else { MessageBox.Show(":(", "Authorization failed"); } } else { MessageBox.Show(e.error, "Authorization failed"); } AppNetDotNet.Model.Authorization.clientSideFlow apnClientAuthProcess = new AppNetDotNet.Model.Authorization.clientSideFlow(ApiKeys.appNetClientID, ApiKeys.appNetRedirectUri, "basic stream write_post follow messages"); apnClientAuthProcess.AuthSuccess += apnClientAuthProcess_AuthSuccess; apnClientAuthProcess.showAuthWindow(); } }
public void add_new_account() { AppNetDotNet.Model.Authorization.registerAppInRegistry(AppNetDotNet.Model.Authorization.registerBrowserEmulationValue.IE8Always, alsoCreateVshostEntry: true); AppNetDotNet.Model.Authorization.clientSideFlow auth_window = new AppNetDotNet.Model.Authorization.clientSideFlow(api_key, Common.redirect_url, "basic write_post files"); auth_window.AuthSuccess += auth_window_AuthSuccess; auth_window.showAuthWindow(); }
public static void authorizeNewAccount() { AppNetDotNet.Model.Authorization.clientSideFlow apnClientAuthProcess = new AppNetDotNet.Model.Authorization.clientSideFlow(API.ConnectionData.appDotNetSecret, API.ConnectionData.appDotNetRedirectUrl, "basic stream write_post follow messages files update_profile"); apnClientAuthProcess.AuthSuccess += apnAuthProcess_AuthSuccess; apnClientAuthProcess.showAuthWindow(); }