private void wbTwitchAuth_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { Utils.clearIECache(); if (e.Uri.Host.Trim() == "localhost") { if (_isStreamer) { Config.StreamerOAuthKey = Utils.GetTwitchAuthToken(e.Uri.AbsoluteUri); } else { Config.BotOAuthKey = Utils.GetTwitchAuthToken(e.Uri.AbsoluteUri); } this.Close(); } }
private void wbTwitchAuth_Navigating(object sender, System.Windows.Forms.WebBrowserNavigatingEventArgs e) { Utils.clearIECache(); MessageBox.Show(e.Url.AbsoluteUri); if (e.Url.Host.Trim() == "localhost") { if (_isStreamer) { Config.StreamerOAuthKey = "oauth:" + Utils.GetTwitchAuthToken(e.Url.AbsoluteUri); } else { Config.BotOAuthKey = "oauth:" + Utils.GetTwitchAuthToken(e.Url.AbsoluteUri); } this.Close(); } }
public WindowAuthBrowser(bool isStreamer) { _isStreamer = isStreamer; InitializeComponent(); Utils.clearIECache(); Utils.InternetSetOption(IntPtr.Zero, 42, IntPtr.Zero, 0); Utils.SuppressWininetBehavior(); if (_isStreamer) { wbTwitchAuth.Navigate(twitchAuthLinkStreamer); } else { wbTwitchAuth.Navigate(twitchAuthLinkBot); } }