Beispiel #1
0
        public ContainSearch(SearchInGraph myForm)
        {
            this.ParentForm = myForm;
            InitializeComponent();

            comboBox1.DataSource    = new BindingSource(MainForm.MyGraph.getMap(), null);
            comboBox1.DisplayMember = "Key";
            comboBox1.ValueMember   = "Value";

            comboBox2.DataSource    = new BindingSource(MainForm.MyGraph.getMap(), null);
            comboBox2.DisplayMember = "Key";
            comboBox2.ValueMember   = "Value";
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int lenght     = Int32.Parse(textBox1.Text);
                int ignoreLink = 0;
                int IgnoreNodeWithWeightGraterThan = 0;

                RadioButton radioBtn = this.Controls.OfType <RadioButton>()
                                       .Where(x => x.Checked).FirstOrDefault();
                if (radioBtn != null)
                {
                    switch (radioBtn.Name)
                    {
                    case "radioButton1":
                        ignoreLink = 1;         //ignores one way links
                        break;

                    case "radioButton2":
                        ignoreLink = 2;         //ignores two way links
                        break;

                    case "radioButton3":
                        ignoreLink = 0;        //ignores none
                        break;

                    default: break;
                    }
                    IgnoreNodeWithWeightGraterThan = Int32.Parse(textBox1.Text);
                    SearchInGraph.startSearch(new BreadthFirstSearchWithIgnoreCase(MainForm.MyGraph, ignoreLink, IgnoreNodeWithWeightGraterThan), ParentForm.comboBox2.Text, ParentForm.comboBox3.Text);
                }
            }
            catch (ArgumentNullException)
            {
                Interaction.MsgBox("all Fields should be filed!!!");
            }
            catch (OverflowException)
            {
                Interaction.MsgBox("values are too big");
            }
            catch (FormatException)
            {
                Interaction.MsgBox("all Fields should be filed!!!");
            }
            this.Close();
        }
Beispiel #3
0
 public IgnoreCaseSearch(SearchInGraph myForm)
 {
     InitializeComponent();
     this.ParentForm = myForm;
     textBox1.Text   = "0";
 }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            SearchInGraph.startSearch(new BreadthFirstSearchWithContainSearch(MainForm.MyGraph, comboBox1.Text, comboBox2.Text), ParentForm.comboBox2.Text, ParentForm.comboBox3.Text);

            this.Close();
        }