Exemple #1
0
        public LoginFormEx(BoxProvider boxProvider, string ticket)
        {
            InitializeComponent();

            this.boxProvider = boxProvider;
            this.ticket = ticket;
        }
Exemple #2
0
        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);
            }
        }