Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 3
0
        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());
            }
        }
Ejemplo n.º 4
0
 private void LoginButton_Click(object sender, RoutedEventArgs e)
 {
     TwitchAPIInterface.Login();
 }