void HandleAuthenticationStateChangeEvent(object sender, Extension.Auth.AuthenticationStateChangeEventArgs e) { // an authentication event occured, determine which one and act accordingly log.Debug("An auth event occured, check which one occured"); if (e.isAuthorized) { log.Debug("Authorized event occured."); // suppress/check the button log.Debug("Setting the button checked state to true."); this.Checked = true; // update the token object log.Debug("Updating the auth token object."); this.ext.setToken(e.token); } else { log.Info("Non-authorized event occured (may have signed out)."); // unsupress/uncheck the button log.Debug("Setting the button checked state to false."); this.Checked = false; } }
void HandleAuthenticationStateChangeEvent(object sender, Extension.Auth.AuthenticationStateChangeEventArgs e) { // an authentication event occured, determine which one and act accordingly if (e.isAuthorized) { // TODO: Handle authorization event. } }
void HandleAuthenticationStateChangeEvent(object sender, Extension.Auth.AuthenticationStateChangeEventArgs e) { // an authentication event occured, determine which one and act accordingly if (e.isAuthorized && !e.isViewOnly && ext.hasAtLeastOneLayer()) { // suppress/check the button this.Enabled = false; } else { // unsupress/uncheck the button this.Enabled = false; } }
void HandleAuthenticationStateChangeEvent(object sender, Extension.Auth.AuthenticationStateChangeEventArgs e) { // an authentication event occured, determine which one and act accordingly if (e.isAuthorized && ext.isExtensionEnabled() && ext.hasAtLeastOneLayer()) { // the user is authorized, verify the button is also enabled log.Debug("Extension is enabled, enable button and check to verify the user has an auth token."); this.Enabled = true; } else { // unsupress/uncheck the button this.Enabled = false; } }