Ejemplo n.º 1
0
        private void lvFreeList_ItemChecked(object sender, ItemCheckedEventArgs e)
        {
            try
            {
                if (_isBinding)
                {
                    return;
                }
                if (lvFreeList.SelectedItems.Count <= 0)
                {
                    return;
                }

                ListViewItem lvi = lvFreeList.SelectedItems[0];

                if (lvi.Tag == null)
                {
                    JReportWordSection wordSection = new JReportWordSection(lvi.Text, rtbFreeContext.Text);
                    lvi.Tag = wordSection;
                }

                IsModify = true;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 2
0
        private void tsbSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (_wordData == null)
                {
                    return;
                }

                _wordData.词句信息.词句明细.Clear();

                _wordData.词句信息.词句类型 = tsCbxType.SelectedIndex;

                foreach (ListViewItem lvi in lvFreeList.Items)
                {
                    if (lvi.Checked)
                    {
                        JReportWordSection wordSection = lvi.Tag as JReportWordSection;

                        _wordData.词句信息.词句明细.Add(wordSection);
                    }
                }

                _rwm.UpdateWordItem(_wordData);

                IsModify = false;

                _isOk = true;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 3
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                _isReadContext = true;

                rtbFreeContext.Text = "";

                if (lvFreeList.SelectedItems.Count <= 0)
                {
                    return;
                }

                ListViewItem lvi = lvFreeList.SelectedItems[0];

                if (lvi.Tag == null)
                {
                    return;
                }

                JReportWordSection wordSection = lvi.Tag as JReportWordSection;

                rtbFreeContext.Text = wordSection.段落内容;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
            finally
            {
                _isReadContext = false;
            }
        }
Ejemplo n.º 4
0
        private void rtbFreeContext_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (_isBinding)
                {
                    return;
                }
                if (_isReadContext)
                {
                    return;
                }

                if (lvFreeList.SelectedItems.Count <= 0)
                {
                    return;
                }

                ListViewItem lvi = lvFreeList.SelectedItems[0];

                if (lvi.Tag == null)
                {
                    JReportWordSection wordSection = new JReportWordSection(lvi.Text, rtbFreeContext.Text);
                    lvi.Tag = wordSection;
                }
                else
                {
                    JReportWordSection wordSection = lvi.Tag as JReportWordSection;
                    wordSection.段落内容 = rtbFreeContext.Text;
                }

                if (string.IsNullOrEmpty(rtbFreeContext.Text))
                {
                    lvi.Checked = false;
                }
                else
                {
                    lvi.Checked = true;
                }

                IsModify = true;
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }