예제 #1
0
        public Form1()
        {
            InitializeComponent();

            // Skapar en form för att adda watches redan nu.
            add_form         = new watch_add_form(this);
            add_form.Visible = false;

            // Set some options
            option_popups = true;

            // Create some default watches/parsers
            watches = new List <watch>();
            watches.Add(new watch("Blocket - Allt", new parser_blocket("http://www.blocket.se/hela_sverige?q="), 3600, this));
            //watches.Add(new watch("Blocket - Iphone", new parser_blocket("http://www.blocket.se/hela_sverige?q=iphone"), 120, this));
            //watches.Add(new watch("Tradera - Sista minuten", new parser_tradera("http://www.tradera.com/category/category.aspx?special=1"), 2, this));
            current_watch = watches[0];
            watches_listbox.DataSource    = watches;
            watches_listbox.SelectedIndex = 0;

            // Manual gets the first round of items
            //foreach (watch w in watches)
            //{
            //    w.update();
            //}
            updateVisuals();
        }
예제 #2
0
 private void watches_listbox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (watches_listbox.SelectedIndex == -1)
     {
         watches_listbox.SelectedIndex = 0;
     }
     current_watch = watches[watches_listbox.SelectedIndex];
     updateVisuals();
 }