Ejemplo n.º 1
0
        private void ProjectTreeView_CellEditFinishing(object sender, CellEditEventArgs e)
        {
            if (e.ListViewItem.RowObject is ProjectElementNode elementNode)
            {
                string newName = e.NewValue as string;
                if (string.IsNullOrEmpty(newName))
                {
                    e.Cancel = true;
                    return;
                }

                if (!e.Cancel)
                {
                    newName    = CurrentProject.RenameElement(elementNode.Element, newName);
                    e.NewValue = newName;
                }
            }
        }
Ejemplo n.º 2
0
        private void NameTextBox_Validated(object sender, EventArgs e)
        {
            var newName = CurrentProject.RenameElement(ProjectManager.SelectedElement, NameTextBox.Text);

            NameTextBox.Text = newName;
        }