/// <summary> /// Shows a dialog to rename a folder. Note that if the root folder is specified, the function /// returns without showing a dialog. /// </summary> /// <param name="folderName">Folder to rename.</param> public void ShowFolderRenameDialog(string folderName) { ProjectFolder.ThrowExceptionOnInvalidFullFolderPath(folderName); if (folderName == ProjectFolder.RootFolderName) { return; } var tvctrl = new Altaxo.Gui.Common.TextValueInputController(ProjectFolder.ConvertFolderNameToDisplayFolderName(folderName), "Enter the new name of the folder:"); if (!Current.Gui.ShowDialog(tvctrl, "Rename folder", false)) { return; } var newFolderName = ProjectFolder.ConvertDisplayFolderNameToFolderName(tvctrl.InputText.Trim()); if (!CanRenameFolder(folderName, newFolderName)) { if (false == Current.Gui.YesNoMessageBox( "Some of the new item names conflict with existing items. Those items will be renamed with " + "a generated name based on the old name. Do you want to continue?", "Attention", false)) { return; } } RenameFolder(folderName, newFolderName); }
public static void ShowRenameDialog(this GraphDocument doc) { var tvctrl = new Altaxo.Gui.Common.TextValueInputController(doc.Name, "Enter a name for the graph:"); tvctrl.Validator = new GraphRenameValidator(doc); if (Current.Gui.ShowDialog(tvctrl, "Rename graph", false)) doc.Name = tvctrl.InputText.Trim(); }
public static void ShowRenameDialog(this TextDocument doc) { var tvctrl = new Altaxo.Gui.Common.TextValueInputController(doc.Name, "Enter a name for the text document:") { Validator = new TextDocumentRenameValidator(doc) }; if (Current.Gui.ShowDialog(tvctrl, "Rename text document", false)) doc.Name = tvctrl.InputText.Trim(); }