public MainWindow() { //System.Threading.Thread.CurrentThread.CurrentUICulture = Properties.Settings.Default.Lang; //LangChange(); FilmStorage.StorageRead(); rootElement = this; this.DataContext = this; InitializeComponent(); }
static public void StorageRead() { FilmStorage.Actors = new Chain <Actor>(); FilmStorage.Films = new Chain <Film>(); FilmStorage.Producers = new Chain <Producer>(); FilmStorage.Entities = new Entities(); if (!File.Exists(Path.Combine(FolderPath, ZipName))) { if (!Directory.Exists(FolderPath)) { Directory.CreateDirectory(FolderPath); } if (!File.Exists(FullPath)) { File.Delete(FullPath); } AddRecords(); } else { DirectoryInfo directorySelected = new DirectoryInfo(FolderPath); foreach (FileInfo fileToDecompress in directorySelected.GetFiles("*.gz")) { Decompress(fileToDecompress); } string str = new FilmStorage().LoadStorage(); Entities = Repository.Serializer.Serializer.ToObj <Entities>(str); Producers = Entities.Pruducers; Films = Entities.Films; Actors = Entities.Actors; //Planets = PlanetFormatter.GetPlanetList(str); //Stars = StarFormatter.GetStarList(str); //Constellations = ConstellationFormatter.GetConstellationList(str); //EntitiesFormatter.MakeEntity(str); } }
private void btn_Exit_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { FilmStorage.StorageWrite(); Application.Current.MainWindow.Close(); }