private void btnAddExtraDesc_Click(object sender, EventArgs e) { EditExtendedDescription dialog = new EditExtendedDescription(new ExtendedDescription()); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.Add(dialog.GetExtendedDescription()); } }
private void btnAddMessage_Click(object sender, EventArgs e) { EditExtendedDescription dialog = new EditExtendedDescription(new TalkData()); if (dialog.ShowDialog() == DialogResult.OK) { lstMessages.Items.Add(dialog.GetTalkData()); } }
private void btnEditMessage_Click(object sender, EventArgs e) { int index = lstMessages.SelectedIndex; if (index != -1) { TalkData desc = lstMessages.SelectedItem as TalkData; EditExtendedDescription dialog = new EditExtendedDescription(desc); if (dialog.ShowDialog() == DialogResult.OK) { lstMessages.Items.RemoveAt(index); lstMessages.Items.Insert(index, dialog.GetTalkData()); } } }
private void btnEditExtraDescr_Click(object sender, EventArgs e) { int index = lstExtraDesc.SelectedIndex; if (index != -1) { ExtendedDescription desc = lstExtraDesc.SelectedItem as ExtendedDescription; EditExtendedDescription dialog = new EditExtendedDescription(desc); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.RemoveAt(index); lstExtraDesc.Items.Insert(index, dialog.GetExtendedDescription()); } } }
private void btnEditExtraDescr_Click(object sender, EventArgs e) { int index = lstExtraDesc.SelectedIndex; if (index != -1) { ExtendedDescription desc = lstExtraDesc.SelectedItem as ExtendedDescription; EditExtendedDescription dialog = new EditExtendedDescription(desc); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.RemoveAt(index); lstExtraDesc.Items.Insert(index,dialog.GetExtendedDescription()); } } }