private static DownloadItemList LoadFile()
 {
     if (System.IO.File.Exists(Settings.PathToInstalls + @"Cache.xml"))
     {
         var ser = new System.Xml.Serialization.XmlSerializer(typeof(DownloadItemList));
         var ms  = new System.IO.MemoryStream(System.IO.File.ReadAllBytes(Settings.PathToInstalls + @"Cache.xml"));
         DownloadItemList cache = (DownloadItemList)ser.Deserialize(ms);
         return(cache);
     }
     return(null);
 }
        public static DownloadItemList GetList()
        {
            DownloadItemList retVal = LoadFile();

            if (retVal == null)
            {
                retVal = new DownloadItemList();
                retVal.RefreshData();
            }
            return(retVal);
        }
Esempio n. 3
0
 public static void RefreshItems()
 {
     items = DownloadItemList.GetList();
 }