public static IEnumerable <VizCmd> AddDialog(string txt, TimeMark tm) { var dlg = new dlgProps(); var txtTm = dlg.AddNewTextBox("Time:", tm.ToString()); var txtTxt = dlg.AddNewTextBox("Text:", txt); dlg.MaximizeBox = false; dlg.MinimizeBox = false; dlg.StartPosition = FormStartPosition.CenterScreen; var result = dlg.ShowDialog(); if (result == DialogResult.OK) { if (Global.Instance.Song.TimeMarkTryParse(txtTm.Text, out tm)) { Dictionary <string, object> dict = new Dictionary <string, object>() { { "type", typeof(Lyric) }, { "text", txtTxt.Text }, { "tm", tm } }; return(new[] { new VizCmd(null, Cmd.Insert, dict) }); } } return(null); }
public override XElement Serialize(Song song) { return(new XElement("step", new XAttribute("begin", startTimeMark.ToString()), new XAttribute("end", endTimeMark.ToString()), new XAttribute("text", text))); }
public override XElement Serialize(Song song) => new XElement("lyric", new XAttribute("time", timemark.ToString()), new XAttribute("text", text));