Exemplo n.º 1
0
        private void LoadTags()
        {
            foreach (string tag in material.Tags)
            {
                Run run = new Run(tag);


                Hyperlink hyperlink = new Hyperlink(run);
                hyperlink.FontSize = 16;
                hyperlink.Click   += delegate(object sender, RoutedEventArgs e)
                {
                    //run advanced shearch with the tag
                    Dictionary <Material, Double> searchResult = controler.RetreiveMaterialsAdvancedSearch(tag);
                    //open results window
                    PresentResultsWindow win = new PresentResultsWindow(controler, searchResult);
                    win.Show();
                    //close this window
                    this.Close();
                };
                TextBlock tb = new TextBlock();
                tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
                tb.Inlines.Add(hyperlink);

                tagsLinks.Children.Add(tb);
            }
        }
Exemplo n.º 2
0
 private void SimpleSearch_Click(object sender, RoutedEventArgs e)
 {
     if (queryTextBox == null || queryTextBox.Text == "")
     {
         MessageBox.Show("No Query", "Error", MessageBoxButton.OK);
     }
     else
     {
         Dictionary <Material, Double> res = _controller.RetreiveMaterialsSimpleSearch(queryTextBox.Text);
         PresentResultsWindow          win = new PresentResultsWindow(_controller, res);
         win.ShowDialog();
     }
 }
Exemplo n.º 3
0
        private void AdvancedSearch_Click(object sender, RoutedEventArgs e)
        {
            AdvancedSearchWindow win1 = new AdvancedSearchWindow(ref _controller);

            if (win1.ShowDialog() == true)
            {
                Dictionary <Material, double> results = _controller.RetreiveMaterialsAdvancedSearch(win1.University, win1.University, win1.CourseNo, win1.CourseName, win1.Title
                                                                                                    , win1.Topics, win1.Tags, win1.Category, win1.IsPrinted);

                //should open reasults window
                PresentResultsWindow win2 = new PresentResultsWindow(_controller, results);
                win2.ShowDialog();
            }
        }