using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StarTrinity.Tester
{
    public partial class TesterMainWindow : Form
    {
        readonly Timer timer;
        public TesterMainWindow()
        {
            InitializeComponent();
            Navigate();
            timer = new Timer();
            timer.Tick += new EventHandler(timer_Tick);
        }

        void timer_Tick(object sender, EventArgs e)
        {
            Navigate();
        }

        void Navigate()
        {
            webBrowser.Url = new Uri(textBoxUrl.Text);
        }

        private void checkBoxRunTest_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxRunTest.Checked)
            {
                timer.Interval = Int32.Parse(textBoxPeriod.Text);
                timer.Start();
            }
            else
                timer.Stop();
        }
    }
}
