private void renameSToolStripMenuItem_Click(object sender, EventArgs e) { try { Control control = GetSourceControl((sender as ToolStripMenuItem).GetCurrentParent()) as Control; MWTreeView resutltsTree = control as MWTreeView; if (resutltsTree != null) { BulkMacroTreeNode bulkMacroTreeNode = resutltsTree.SelNode as BulkMacroTreeNode; if (bulkMacroTreeNode != null) { if (!bulkMacroTreeNode.isParentNode) { RenameStepForm form = new RenameStepForm(bulkMacroTreeNode.stepTitle); DialogResult dialog = form.ShowDialog(); if (dialog == DialogResult.OK) { bulkMacroTreeNode.stepTitle = form.Controls["txtNewStepTitle"].Text; bulkMacroTreeNode.Text = bulkMacroTreeNode.Text.Split(new char[] { '|' })[0] + "| " + form.Controls["txtNewStepTitle"].Text; UpdateEventsFileWithNewName(bulkMacroTreeNode); } } } } } catch (Exception ex) { CommonUtils.ShowError(ex.Message, ex); } }
private void renameStepToolStripMenuItem_Click(object sender, EventArgs e) { try { checkboxItems item = (chkLstAllStepEvents.SelectedItem as checkboxItems); if (item != null) { RenameStepForm form = new RenameStepForm(item.stepTitle); DialogResult dialog= form.ShowDialog(); if (dialog == DialogResult.OK) { item.stepTitle = form.Controls["txtNewStepTitle"].Text; chkLstAllStepEvents.SelectedItem = item; chkLstAllStepEvents.Refresh(); } } } catch (Exception ex) { CommonUtils.ShowError(ex.Message, ex); } }