Пример #1
0
 static Database()
 {
     TempData = new TempData();
     SavedData = DataSaver<SavedData>.Load("SavedData");
     if (SavedData == null)
         SavedData = new SavedData();
 }
Пример #2
0
 internal static ImageSource GetFactoryImage(Factory factory)
 {
     if (factory != null)
     {
         string name = "factory" + factory.Id;
         var bytes = DataSaver<byte[]>.Load(name);
         if (bytes == null)
             return null;
         var imgSource = new BitmapImage();
         imgSource.SetSource(new MemoryStream(bytes));
         return imgSource;
     }
     return null;
 }