internal void AddLinkToList(RssListItem newItem) { File.WriteAllText(Path, String.Empty); RssList.Add(newItem); if (File.Exists(Path)) { using (StreamWriter sw = File.CreateText(Path)) { foreach (var i in RssList) { sw.WriteLine(i.Name + ";" + i.Uri); } } } }
internal void RemoveLinkFromList(RssListItem selectedListItem) { File.WriteAllText(Path, String.Empty); RssList.Remove(selectedListItem); if (File.Exists(Path)) { using (StreamWriter sw = File.CreateText(Path)) { foreach (var i in RssList) { sw.WriteLine(i.Name + ";" + i.Uri); } } } }
private ObservableCollection <RssListItem> GetRssList() { var listitems = new ObservableCollection <RssListItem>(); List <string> lines = File.ReadAllLines(Path).ToList(); foreach (var l in lines) { string[] split = l.Split(';'); RssListItem listitem = new RssListItem() { Name = split[0], Uri = split[1] }; listitems.Add(listitem); } return(listitems); }
private ObservableCollection<RssListItem> GetRssList() { var listitems = new ObservableCollection<RssListItem>(); List<string> lines = File.ReadAllLines(Path).ToList(); foreach (var l in lines) { string[] split = l.Split(';'); RssListItem listitem = new RssListItem() { Name = split[0], Uri = split[1] }; listitems.Add(listitem); } return listitems; }
public void AddLinkToList() { RssListItem newItem = new RssListItem() { Name = this.Name, Uri = this.Uri }; this.Name = ""; this.Uri = ""; repo.AddLinkToList(newItem); }