Esempio n. 1
0
        /// <summary>
        /// 生成文本
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (txtBaseText.Text.Length != txtReplace.Text.Length)
            {
                MessageBox.Show("源文本与替换文本的长度要一致", "注意");
                return;
            }

            MyChineseConvert convert = new MyChineseConvert();
            List<string> resultList = convert.PinyingConvert(txtBaseText.Text, txtReplace.Text);


            // 先清空结果区域.
            this.txtResult.Text = String.Empty;

            // 依次填写结果数据 (如果有多个的话, 自动换行).
            foreach (String oneResult in resultList)
            {
                this.txtResult.AppendText(oneResult);
                this.txtResult.AppendText("\r\n");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 生成文本
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (txtBaseText.Text.Length != txtReplace.Text.Length)
            {
                MessageBox.Show("源文本与替换文本的长度要一致", "注意");
                return;
            }

            MyChineseConvert convert    = new MyChineseConvert();
            List <string>    resultList = convert.PinyingConvert(txtBaseText.Text, txtReplace.Text);


            // 先清空结果区域.
            this.txtResult.Text = String.Empty;

            // 依次填写结果数据 (如果有多个的话, 自动换行).
            foreach (String oneResult in resultList)
            {
                this.txtResult.AppendText(oneResult);
                this.txtResult.AppendText("\r\n");
            }
        }