コード例 #1
0
        public static DialogResult Show(IEnumerable <Information> informations, out Sentence sentence)
        {
            var frm = new frmGetSimilarSentence();

            frm._informations = informations;

            var result = frm.ShowDialog();

            sentence = new Sentence()
            {
                Text         = frm.txtSentence.Text,
                Informations = new SentenceInformationCollection(frm.ctlList.Items.Cast <SentenceInformation>())
            };

            return(result);
        }
コード例 #2
0
        public static DialogResult Show(IEnumerable <Information> informations, Sentence sentence)
        {
            var frm = new frmGetSimilarSentence();

            frm._informations = informations;

            frm.txtSentence.Text = sentence.Text;
            if (sentence.Informations != null)
            {
                frm.ctlList.Items.AddRange(sentence.Informations.Select(_ => _.Clone()).Cast <object>().ToArray());
            }

            var result = frm.ShowDialog();

            if (result != DialogResult.OK)
            {
                return(result);
            }

            sentence.Text         = frm.txtSentence.Text;
            sentence.Informations = new SentenceInformationCollection(frm.ctlList.Items.Cast <SentenceInformation>());

            return(result);
        }