示例#1
0
 public static void Load()
 {
     try
     {
         BookmarkEntity bookmarkLib;
         XmlSerializer  serializer = new XmlSerializer(typeof(BookmarkEntity));
         if (!File.Exists(BookmarksFile))
         {
             bookmarks = new BookmarkEntity();
         }
         else
         {
             using (TextReader reader = new StreamReader(BookmarksFile))
             {
                 bookmarkLib = (BookmarkEntity)serializer.Deserialize(reader);
                 bookmarks   = bookmarkLib;
             }
         }
     }
     catch
     {
         bookmarks = new BookmarkEntity();
     }
 }
示例#2
0
 public static void Load()
 {
     try
     {
         BookmarkEntity bookmarkLib;
         XmlSerializer  serializer = new XmlSerializer(typeof(BookmarkEntity));
         if (!File.Exists(Utils.GetDataFolderPath() + "\\bookmarks.xml"))
         {
             bookmarks = new BookmarkEntity();
         }
         else
         {
             using (TextReader reader = new StreamReader(Utils.GetDataFolderPath() + "\\bookmarks.xml"))
             {
                 bookmarkLib = (BookmarkEntity)serializer.Deserialize(reader);
                 bookmarks   = bookmarkLib;
             }
         }
     }
     catch
     {
         bookmarks = new BookmarkEntity();
     }
 }