internal void ShowNewPresetDialog(PresetsNamePromptEventArgs e)
{
string error = "";
do
{
var dialog = new PresetPrompt()
{
DescriptionInput = { Text = e.Description },
nameView = { Text = "" },
nameBox = { Text = e.Name },
// center the prompt
Owner = this,
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
if (dialog.ShowDialog() != true)
{
e.Success = false;
return;
}
if (String.IsNullOrEmpty(dialog.Text))
{
//if the name is empty, then default to the current time
e.Name = System.DateTime.Now.ToString();
break;
}
else
{
error = "";
}
e.Name = dialog.Text;
e.Description = dialog.Description;
} while (!error.Equals(""));
e.Success = true;
}