Exemplo n.º 1
0
        private void Search_Click(object sender, EventArgs e)
        {
            Text1.Clear();
            Book book = OurBook();

            if (!LINQ_button.Checked && !DOM_button.Checked && !SAX_button.Checked)
            {
                MessageBox.Show("Ви повинні обрати спосіб пошуку (LINQ, DOM або SAX)");
            }
            // MessageBox.Show(book.BookShop);
            if (LINQ_button.Checked)
            {
                ISearcher currentSearcher = new Linq(path);
                book.Algo = currentSearcher;
                final     = book.Algorithm(book);
                OutPut(final);
            }
            if (DOM_button.Checked)
            {
                ISearcher currentSearcher = new DOM(path);
                book.Algo = currentSearcher;
                final     = book.Algorithm(book);
                OutPut(final);
            }
            if (SAX_button.Checked)
            {
                ISearcher currentSearcher = new SAX(path);
                book.Algo = currentSearcher;
                final     = book.Algorithm(book);
                OutPut(final);
            }
        }
Exemplo n.º 2
0
Arquivo: Form1.cs Projeto: elzayts/OOP
        private void Search_Click(object sender, EventArgs e)
        {
            richTextBox1.Clear();
            Anime a = User_ch();

            if (DOM.Checked)
            {
                Istrategy istrategy = new DOM(path);                                                                                     istrategy = new LINQ(path);
                final = istrategy.Search(a, path);
                Output(final);
            }
            if (SAX.Checked)
            {
                Istrategy istrategy = new SAX(path);
                final = istrategy.Search(a, path);
                Output(final);
            }
            if (LINQ.Checked)
            {
                Istrategy istrategy = new LINQ(path);
                final = istrategy.Search(a, path);
                Output(final);
            }
        }