コード例 #1
0
        private void DoSearch(Wnlib.Opt opt)
        {
            if (opt.sch.ptp.mnemonic == "OVERVIEW")
            {
                Overview();
                return;
            }

            txtOutput.Text = "";
            Refresh();

            list = new ArrayList();
            se   = new Wnlib.Search(txtSearchWord.Text, true, opt.pos, opt.sch, Int16.Parse(txtSenses.Text));
            int a = se.buf.IndexOf("\\n");

            if ((a >= 0))
            {
                if ((a == 0))
                {
                    se.buf = se.buf.Substring(a + 1);
                    a      = se.buf.IndexOf("\\n");
                }
                StatusBar1.Text = se.buf.Substring(0, a);
                se.buf          = se.buf.Substring(a + 1);
            }
            list.Add(se);
            if ((Wnlib.WNOpt.opt("-h").flag))
            {
                help = new Wnlib.WNHelp(opt.sch, opt.pos).help;
            }
            FixDisplay(opt);
        }
コード例 #2
0
ファイル: StartForm.cs プロジェクト: xinxu1018/wordnetdotnet
        private void DoSearch(Wnlib.Opt opt)
        {
            if (opt.sch.ptp.mnemonic == "OVERVIEW")
            {
                Overview();
                return;
            }

            //TextBox3.Text = ""
            //HtmlViewer1.Document.Window.Close();
            //HtmlViewer1.Navigate("about:blank");
            HtmlViewer1.Document.OpenNew(false);
            HtmlViewer1.Visible = false;
            //TextBox1.Enabled = False
            //lblWait.Visible = True
            //Timer1.Enabled = True
            Refresh();

            list = new ArrayList();
            Wnlib.Search se = new Wnlib.Search(TextBox1.Text, true, opt.pos, opt.sch, int.Parse(TextBox2.Text));
            int          a  = se.buf.IndexOf("\n");

            if ((a >= 0))
            {
                if ((a == 0))
                {
                    se.buf = se.buf.Substring(a + 1);
                    a      = se.buf.IndexOf("\n");
                }
                StatusBar1.Text = se.buf.Substring(0, a);
                se.buf          = se.buf.Substring(a + 1);
            }
            AddHistory(new wnHistory(Strings.Replace(TextBox1.Text, " ", "_"), opt, int.Parse(TextBox2.Text)));
            //        history.Add(New wnHistory(TextBox1.Text, opt, Integer.Parse(TextBox2.Text)))
            list.Add(se);
            if ((Wnlib.WNOpt.opt("-h").flag))
            {
                help = new Wnlib.WNHelp(opt.sch, opt.pos).help;
            }
            FixDisplay();
        }
コード例 #3
0
		private void DoSearch(Wnlib.Opt opt)
		{
			if (opt.sch.ptp.mnemonic == "OVERVIEW") {
				Overview();
				return;
			}

			txtOutput.Text = "";
			Refresh();

			list = new ArrayList();
			se = new Wnlib.Search(txtSearchWord.Text, true, opt.pos, opt.sch, Int16.Parse(txtSenses.Text));
			int a = se.buf.IndexOf("\\n");
			if ((a >= 0)) {
				if ((a == 0)) {
					se.buf = se.buf.Substring(a + 1);
					a = se.buf.IndexOf("\\n");
				}
				StatusBar1.Text = se.buf.Substring(0, a);
				se.buf = se.buf.Substring(a + 1);
			}
			list.Add(se);
			if ((Wnlib.WNOpt.opt("-h").flag)) {
				help = new Wnlib.WNHelp(opt.sch, opt.pos).help;
			}
			FixDisplay(opt);
		}