public MainWindow() { InitializeComponent(); timer.Interval = TimeSpan.FromSeconds(60); timer.Tick += UpdateChannels; timer.IsEnabled = true; TwitchAPIInterface.Login(); }
private async void OkButton_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(channelNameTextBox.Text)) { FollowedChannels = await TwitchAPIInterface.GetFollowedChannels(channelNameTextBox.Text); MainWindow.UpdateChannels(); } DialogResult = true; }
private static async void UpdateChannels(object sender, EventArgs args) { onChannelsUpdateStarted?.Invoke(); try { await TwitchAPIInterface.UpdateChannels(Settings.Instance.Channels.ToList()); Console.WriteLine("Channels updated"); onChannelsUpdateFinished?.Invoke(); } catch (Exception exc) { Console.WriteLine(exc.ToString()); } }
private void LoginButton_Click(object sender, RoutedEventArgs e) { TwitchAPIInterface.Login(); }