Пример #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            TreeNode selNode = tvKind.SelectedNode;

            ListView.CheckedIndexCollection selText = lvText.CheckedIndices;

            if (selText == null || selText.Count == 0)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select the items to modify."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (selText.Count != 1)
            {
                MessageBox.Show(LangPack.GetMongolian("Please choose one CG text to modify."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            BoardInfoDetail info = lvText.Items[selText[0]].Tag as BoardInfoDetail;
            BoardEditForm   form = new BoardEditForm(info, isPrimaryCG);

            form.OnCGChangeEvt += new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);
            form.ShowDialog();
            form.OnCGChangeEvt -= new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);

            tvKind.SelectedNode = null;
            tvKind.SelectedNode = selNode;
        }
Пример #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            BoardEditForm form = new BoardEditForm(null, isPrimaryCG);

            form.OnCGChangeEvt += new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);
            form.ShowDialog();
            form.OnCGChangeEvt -= new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);

            lvText.Items.Clear();
            tvKind.SelectedNode = null;
        }
Пример #3
0
        private void lvText_DoubleClick(object sender, EventArgs e)
        {
            TreeNode selNode = tvKind.SelectedNode;

            ListView.SelectedIndexCollection selText = lvText.SelectedIndices;

            BoardInfoDetail info = lvText.Items[selText[0]].Tag as BoardInfoDetail;
            BoardEditForm   form = new BoardEditForm(info, isPrimaryCG);

            form.OnCGChangeEvt += new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);
            form.ShowDialog();
            form.OnCGChangeEvt -= new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);

            tvKind.SelectedNode = null;
            tvKind.SelectedNode = selNode;
        }