Exemplo n.º 1
0
        private void ColorizeRTB(ResolveSong rs)
        {
            for (int i = 0; i < rs.song.Length; i++)
            {
                Color color = Color.Red;
                if (rs.lyricLines.ContainsKey(i))
                {
                    color = Color.Green;
                }
                else if (rs.unknownLines.ContainsKey(i))
                {
                    color = Color.Blue;
                }

                // if using numbered lines
                //int extra = (int)Math.Floor(Math.Log10(i) + 1);
                //if (i == 0)
                //{
                //    extra = 1;
                //}
                rtb.SelectionStart  = rtb.GetFirstCharIndexFromLine(i);// + extra + 1
                rtb.SelectionLength = rs.song[i].Length;

                rtb.SelectionColor = color;
            }
            rtb.SelectionStart  = 0;
            rtb.SelectionLength = 0;
        }
Exemplo n.º 2
0
        public void AddSong(ResolveSong rs)
        {
            current = rs;
            PrintToRTB(current);
            ColorizeRTB(current);

            resolvers.Add(rs);
        }
Exemplo n.º 3
0
        //prints to the rich text box
        public void PrintToRTB(ResolveSong rs)
        {
            rtb.Clear();

            for (int i = 0; i < rs.song.Length; i++)
            {
                rtb.AppendText(rs.song[i] + '\n');
            }
        }
Exemplo n.º 4
0
 public void PasteSong(object sender, EventArgs e)
 {
     current = new ResolveSong(Clipboard.GetText().Split('\n'));
     PrintToRTB(current);
     ColorizeRTB(current);
 }