Beispiel #1
0
        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);
        }
Beispiel #2
0
 public override XElement Serialize(Song song)
 {
     return(new XElement("step",
                         new XAttribute("begin", startTimeMark.ToString()),
                         new XAttribute("end", endTimeMark.ToString()),
                         new XAttribute("text", text)));
 }
Beispiel #3
0
 public override XElement Serialize(Song song) => new XElement("lyric",
                                                               new XAttribute("time", timemark.ToString()),
                                                               new XAttribute("text", text));