private void mSetAuthTokenButton_Click(object sender, EventArgs e) { LoginForm frm = new LoginForm(); frm.ShowPasswordField = false; DialogResult result = frm.ShowDialog(); if (result != System.Windows.Forms.DialogResult.OK) { return; } // attempt to read the previously cached authtoken from file string str = null; try { str = System.IO.File.ReadAllText(kAuthTokenFile); } catch (Exception x) { MessageBox.Show(x.ToString()); return; } AuthToken token = new AuthToken(str); mBroadcastController.ClientSecret = mClientSecretText.Text; mBroadcastController.SetAuthToken(frm.UserName, token); }
private void mRequestAuthTokenButton_Click(object sender, EventArgs e) { LoginForm frm = new LoginForm(); frm.ShowPasswordField = true; DialogResult result = frm.ShowDialog(); if (result != System.Windows.Forms.DialogResult.OK) { return; } mBroadcastController.ClientSecret = mClientSecretText.Text; mBroadcastController.RequestAuthToken(frm.UserName, frm.Password); }