예제 #1
0
 public void AddToHistory(VideoInfos vi)
 {
     if (HistoryList.Find(x => x.Title == vi.Title) == null && HistoryList.Find(x => x.URL == vi.URL) == null)
     {
         HistoryList.Add(vi);
         File.AppendAllText(path, CreateLine(vi));
     }
     Logger.WriteSuccess($"{vi.Title} | ({vi.URL})");
 }
예제 #2
0
        public void RemoveFromHistory(VideoInfos vi)
        {
            HistoryList.Remove(HistoryList.Find(x => x.Title == vi.Title && x.URL == vi.URL));

            string history = string.Empty;

            foreach (VideoInfos vis in HistoryList)
            {
                history += CreateLine(vis);
            }

            File.WriteAllText(path, string.Empty);
            File.AppendAllText(path, history);
        }
예제 #3
0
 private string CreateLine(VideoInfos vi)
 {
     return(string.Concat(string.Format("{0}|||{1}", vi.Title, vi.URL), Environment.NewLine));
 }