public LoginFormEx(BoxProvider boxProvider, string ticket) { InitializeComponent(); this.boxProvider = boxProvider; this.ticket = ticket; }
public MainForm() { InitializeComponent(); try { if (Properties.Settings.Default.RememberToken) { boxProvider = new BoxProvider(API_KEY, Properties.Settings.Default.AuthenticationToken); btnForget.Enabled = true; labelStatus.Text = "You are reconnected to Box with your previous credentials"; } else { boxProvider = new BoxProvider(API_KEY); boxProvider.GetTicketSucceeded += PerformBoxLogin; boxProvider.GetTicketFailed += GetTicketFailed; // This will request a Ticket from box and call the appropriate event handler boxProvider.StartAuthenticationEx(); btnForget.Enabled = false; } } catch (Exception ex) { Trace.WriteLine(ex.Message); } }