Пример #1
0
        private void 添加ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = new EnumValueEditDialog(m_Message, null);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var item = new ListViewItem(dialog.m_EnumName);
                item.SubItems.Add(dialog.m_EnumValue);
                listViewEnum.Items.Add(item);
            }
        }
Пример #2
0
        private void listViewEnum_DoubleClick(object sender, EventArgs e)
        {
            // modify Enum value

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

            var item   = listViewEnum.SelectedItems[0];
            var dialog = new EnumValueEditDialog(m_Message, item.SubItems[0].Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                item.SubItems[0].Text = dialog.m_EnumName;
                item.SubItems[1].Text = dialog.m_EnumValue;
            }
        }