示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            TabForm tf = new TabForm();

            if (tf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (tf.DisplayName == "")
                {
                    MessageBox.Show("Please Enter a Display Name", "Please Enter a Display Name", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }

                Tabs.Tab t = new Tabs.Tab();
                t.DisplayName           = tf.DisplayName;
                t.ExcludeFromAutoSearch = tf.ExcludeFromAutoSearch;
                t.ExcludeKeywords       = tf.UseExcludeKeywordList;
                t.ExcludeSellers        = tf.UseExcludeSellerList;
                t.Index = listBox1.Items.Count;
                t.Name  = tf.DisplayName.Replace(" ", "_");

                Tabs.TabList.Add(t);

                listBox1.Items.Add(t);
            }



            Tabs.SaveTabs();

            onTabsUpdated();
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndices.Count > 0)
            {
                Tabs.Tab oldtab = (Tabs.Tab)listBox1.SelectedItem;
                TabForm  tf     = new TabForm();
                tf.DisplayName           = oldtab.DisplayName;
                tf.ExcludeFromAutoSearch = oldtab.ExcludeFromAutoSearch;
                tf.UseExcludeSellerList  = oldtab.ExcludeSellers;
                tf.UseExcludeKeywordList = oldtab.ExcludeKeywords;


                if (tf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    Tabs.Tab newtab = new Tabs.Tab();
                    newtab.Index = oldtab.Index;

                    newtab.Name                  = oldtab.Name;
                    newtab.DisplayName           = tf.DisplayName;
                    newtab.ExcludeFromAutoSearch = tf.ExcludeFromAutoSearch;
                    newtab.ExcludeSellers        = tf.UseExcludeSellerList;
                    newtab.ExcludeKeywords       = tf.UseExcludeKeywordList;



                    Tabs.TabList.RemoveAt(listBox1.SelectedIndex);

                    Tabs.TabList.Insert(listBox1.SelectedIndex, newtab);


                    //update the searches with the new details...


                    Tabs.SaveTabs();


                    LoadTabs();


                    onTabsUpdated();
                }
            }
        }