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

namespace PlagSearcherPro
{
    public partial class Form2 : Form
    {
        List<string> urls_to_show;
        ushort index = 0;

        public Form2()
        {
            InitializeComponent();
        }

        public void SetUrlsToShow(List<string> input)
        {
            urls_to_show = new List<string>(input);
            index = 0;
            WebBrowserResult.Navigate(new Uri("https://www.google.cz/search?q=" + urls_to_show[0], UriKind.Absolute));
            LabelIndex.Text = String.Format("Výsledek 1 z {0}.", urls_to_show.Count);
        }

        private void ButtonPrevClick(object sender, EventArgs e)
        {
            if (index > 0)
            {
                index--;
                WebBrowserResult.Navigate(new Uri("https://www.google.cz/search?q=" + urls_to_show[index], UriKind.Absolute));
                LabelIndex.Text = String.Format("Výsledek {0} z {1}.", index + 1, urls_to_show.Count);
            }
        }

        private void ButtonNextClick(object sender, EventArgs e)
        {
            if (index < (urls_to_show.Count - 1))
            {
                index++;
                WebBrowserResult.Navigate(new Uri("https://www.google.cz/search?q=" + urls_to_show[index], UriKind.Absolute));
                LabelIndex.Text = String.Format("Výsledek {0} z {1}.", index + 1, urls_to_show.Count);
            }
        }
    }
}
