Example #1
0
        private void btnEditEngine_Click(object sender, EventArgs e)
        {
            //
            EngineInfo.Engine  engine             = engineInfos[listBoxAPIs.SelectedIndex].Engines[listBoxEngines.SelectedIndex];
            Search_engine_form search_Engine_Form = new Search_engine_form(listBoxEngines.SelectedIndex, engine.Title, engine.Cx, engine.Filters);
            var result = search_Engine_Form.ShowDialog();

            if (result == DialogResult.OK)
            {
                string        title   = search_Engine_Form.title; //values preserved after close
                string        cx      = search_Engine_Form.cx;    //values preserved after close
                List <string> filters = search_Engine_Form.filters;
                engine = new EngineInfo.Engine(title, cx, filters);
                engineInfos[listBoxAPIs.SelectedIndex].Engines[listBoxEngines.SelectedIndex] = engine;
                //Do something here with these values
            }
        }
Example #2
0
        private void btnAddEngine_Click(object sender, EventArgs e)
        {
            Search_engine_form search_Engine_Form = new Search_engine_form();
            //search_Engine_Form.Show();
            var result = search_Engine_Form.ShowDialog();

            if (result == DialogResult.OK)
            {
                string            title   = search_Engine_Form.title; //values preserved after close
                string            cx      = search_Engine_Form.cx;    //values preserved after close
                List <string>     filters = search_Engine_Form.filters;
                EngineInfo.Engine engine  = new EngineInfo.Engine(title, cx, filters);
                List <Engine>     engines = new List <Engine>(engineInfos[listBoxAPIs.SelectedIndex].Engines);
                engines.Add(engine);
                engineInfos[listBoxAPIs.SelectedIndex].Engines = engines.ToArray();
                listBoxAPISelectedIndexChanged(listBoxAPIs, EventArgs.Empty);
                //Do something here with these values
            }
        }
Example #3
0
        private void btnInsertSearchEngine_Click(object sender, EventArgs e)
        {
            Search_engine_form search_Engine_Form = new Search_engine_form();
            //search_Engine_Form.Show();
            var result = search_Engine_Form.ShowDialog();

            if (result == DialogResult.OK)
            {
                string            title   = search_Engine_Form.title; //values preserved after close
                string            cx      = search_Engine_Form.cx;    //values preserved after close
                List <string>     filters = search_Engine_Form.filters;
                EngineInfo.Engine engine  = new EngineInfo.Engine(title, cx, filters);
                engines.Add(engine);
                refreshCheckList();
                //Do something here with these values
            }
            if (result == DialogResult.Cancel)
            {
                //search_Engine_Form.Close();
            }
        }
Example #4
0
        private void btnEditSearchEngine_Click(object sender, EventArgs e)
        {
            EngineInfo.Engine  engine             = (EngineInfo.Engine)listCheckedSearchEngines.Items[listCheckedSearchEngines.SelectedIndex];
            Search_engine_form search_Engine_Form = new Search_engine_form(listCheckedSearchEngines.SelectedIndex, engine.Title, engine.Cx);
            var result = search_Engine_Form.ShowDialog();

            if (result == DialogResult.OK)
            {
                string        title   = search_Engine_Form.title; //values preserved after close
                string        cx      = search_Engine_Form.cx;    //values preserved after close
                List <string> filters = search_Engine_Form.filters;
                int           index   = search_Engine_Form.index;
                engine         = new EngineInfo.Engine(title, cx, filters);
                engines[index] = engine;
                refreshCheckList();
                //Do something here with these values
            }
            if (result == DialogResult.Cancel)
            {
                //search_Engine_Form.Close();
            }
        }