private void buttonGenerateGrid_Click(object sender, EventArgs e)
{
Common.Controls.TextDialog prompt = new Common.Controls.TextDialog("How often (in seconds) should the marks be generated?","Mark Period","0:00.050");
if (prompt.ShowDialog() == DialogResult.OK)
{
TimeSpan interval;
bool conversionSuccess = TimeSpan.TryParseExact(prompt.Response, TimeFormats.PositiveFormats, null, out interval);
if (conversionSuccess)
{
TimeSpan currentTime = interval;
TimeSpan endTime = _timedSequenceEditorForm.Sequence.Length;
while (currentTime <= endTime)
{
_displayedCollection.Marks.Add(currentTime);
currentTime += interval;
}
if (_displayedCollection.Level < 8) {
_displayedCollection.Level = 8;
}
_displayedCollection.Marks.Sort();
PopulateMarkListFromMarkCollection(_displayedCollection);
UpdateMarkCollectionInList(_displayedCollection);
}
else
{
MessageBox.Show("Error parsing time: please use the format '<minutes>:<seconds>.<milliseconds>'", "Error parsing time");
}
}
}