public void AddLineAt(int index, Lrc line) { if (index < 0 || index > lrcList.Count) { return; } lrcList.Insert(index, line); }
public void LoadFromStringWithoutTime(string content) { Clear(); string[] list = content.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); foreach (string temp in list) { Lrc l = new Lrc("[00:00.000]" + temp); lrcList.Add(l); } }
public void MoveLineDown(int index) { if (index < 0 || index >= lrcList.Count - 1) { return; } Lrc temp = GetLineAt(index); RemoveLineAt(index); AddLineAt(index + 1, temp); }
public void MoveLineUp(int index) { if (index <= 0 || index >= lrcList.Count) { return; } Lrc temp = GetLineAt(index); RemoveLineAt(index); AddLineAt(index - 1, temp); }
/// <summary> /// 用于按时间排列的参考依据 /// </summary> /// <param name="obj"></param> /// <returns></returns> public int CompareTo(object obj) { Lrc o = (Lrc)obj; if (ActualTime > o.ActualTime) { return(1); } else if (ActualTime.TotalSeconds == o.ActualTime.TotalSeconds) { return(0); } else { return(-1); } }
public void AddLine(Lrc line) { lrcList.Add(line); }