Exemplo n.º 1
0
        private void ToolStripMenuItemAddField_Click(object sender, EventArgs e)
        {
            // add field
            var dialog = new MessageFieldEditDialog(m_Message, null);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var item = CreateListViewItemByField(dialog.m_FieldInfo);
                listDataField.Items.Add(item);
            }
        }
Exemplo n.º 2
0
        private void ModifyField_Click(object sender, EventArgs e)
        {
            // modify field
            if (listDataField.SelectedItems.Count == 0)
            {
                return;
            }

            var item   = listDataField.SelectedItems[0];
            var dialog = new MessageFieldEditDialog(m_Message, item.SubItems[2].Text);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var field = dialog.m_FieldInfo;
                item.SubItems[0].Text = field.m_index.ToString();
                item.SubItems[1].Text = field.m_type_name + (field.m_is_array ? "[]" : "");
                item.SubItems[2].Text = field.m_name;
            }
        }