From 1581403478fd6de50cc762d2d773e5025a56c221 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Fri, 6 Jun 2014 12:05:25 -0400 Subject: [PATCH] Try to come up with smart project names if no default is specified in template --- .../Dialogs/NewDialog.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CSharp/Environments/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/NewDialog.cs b/CSharp/Environments/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/NewDialog.cs index b4793111..46d11978 100644 --- a/CSharp/Environments/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/NewDialog.cs +++ b/CSharp/Environments/WindowsForms/Engines/UniversalEditor.UserInterface.WindowsForms.DesktopApplication/Dialogs/NewDialog.cs @@ -259,7 +259,16 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs ProjectTemplate pt = (lvProjectTemplates.SelectedItems[0].Data as ProjectTemplate); if (pt == null) return; - if (!txtProjectTitle_IsChanged) txtProjectTitle.Text = pt.ProjectNamePrefix + "1"; + if (!txtProjectTitle_IsChanged) + { + string projectNamePrefix = pt.ProjectNamePrefix; + if (String.IsNullOrEmpty(projectNamePrefix)) + { + projectNamePrefix = pt.Title.Replace(" ", String.Empty); + // projectNamePrefix = "Project"; + } + txtProjectTitle.Text = projectNamePrefix + "1"; + } } private bool txtProjectTitle_IsChanged = false;