Example #1
0
        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);
                    }
                }
            }
        }
Example #2
0
        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);
                    }
                }
            }
        }
Example #3
0
        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);
                    }
                }
            }
        }
Example #4
0
        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);
        }
Example #5
0
        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);
                    }
                }
            }
        }
Example #6
0
        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);
        }