示例#1
0
 /// <summary>
 /// Save MRU list to XML file.
 /// </summary>
 /// <param name="path"></param>
 /// <param name="VM"></param>
 public static void Save(string path, IMRUListViewModel VM)
 {
     try
     {
         XmlSerializerUtil.Save <MRUList>(path, ConvertToModel(VM));
     }
     catch
     {
         throw;
     }
 }
示例#2
0
 /// <summary>
 /// Save MRU list to XML file in an awaitable fashion.
 /// </summary>
 /// <param name="path"></param>
 /// <param name="VM"></param>
 /// <returns></returns>
 public static Task <bool> SaveAsync(string path, IMRUListViewModel VM)
 {
     return(Task.Run(() =>
     {
         try
         {
             XmlSerializerUtil.Save <MRUList>(path, ConvertToModel(VM));
             return true;
         }
         catch
         {
             throw;
         }
     }));
 }