コード例 #1
0
 private void SearchButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         sa = this.SearchAlgorithmComboBox.SelectedIndex == 0 ? (SearchAlgorithm) new BidirectionalSearch() : new GreedySearch();
         sa.searchDidFinishedWithData = SearchDidFinishedWithData;
         sa.AsynchronousSearch(this.Graph, new Vertex(rootVertexChkbx.Text), new Vertex(goalVertexChkbx.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #2
0
 private void SearchButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         sa = this.SearchAlgorithmComboBox.SelectedIndex == 0 ? (SearchAlgorithm) new BidirectionalSearch() : new GreedySearch();
         sa.searchDidFinishedWithData = SearchDidFinishedWithData;
         sa.AsynchronousSearch(this.Graph, new Vertex(rootVertexChkbx.Text), new Vertex(goalVertexChkbx.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }