Beispiel #1
0
        //
        public void populateFavorites()
        {
            if (Directory.Exists(@"Favorites"))
            {
                if (File.Exists(@"Favorites\Author"))
                {// populate the list
                    FileStream fs = new FileStream(@"Favorites\Author", FileMode.Open,FileAccess.Read);
                    BinaryFormatter bf = new BinaryFormatter();
                    object inf =  bf.Deserialize(fs);
                    ListofAuthor = (AuthorList)inf;
                    fs.Close();

                }

                if (File.Exists(@"Favorites\Journal"))
                {
                    //Populate the list
                    FileStream fs = new FileStream(@"Favorites\Journal", FileMode.Open,FileAccess.Read);
                    BinaryFormatter bf = new BinaryFormatter();
                    object inf = bf.Deserialize(fs);
                    ListofJournal = (JournalList)inf;
                    fs.Close();
                }

            }
            else
            {
                Directory.CreateDirectory(@"Favorites");
            }
        }
Beispiel #2
0
 public Favorite()
 {
     ListofAuthor = new AuthorList();
     ListofJournal = new JournalList();
 }