public MainWindow() { InitializeComponent(); Reset(); if (Context == null) { Context = new GameListContext(); } Context.Games.Load(); gameList.ItemsSource = Context.Games.Local; Context.Developers.Load(); developersList.ItemsSource = Context.Developers.Local; this.DataContext = this; if (Context.Games.Count() == 0) //for testing purposes { Context.Developers.Add(new Developer("1C Studios")); Context.Developers.Add(new Developer("Bohemia Interactive")); Context.Developers.Add(new Developer("Paradox Interactive")); Context.Developers.Add(new Developer("Anomaly Developers")); Context.Games.Add(new GameUnit("IL-2 Sturmovik: 1946", "Old, but gold! An epic WW2 combat flight-simulator. Even has the Yugoslav Rogozarski IK-3, how cool is that?!", "", "", new List <Genre> { Genre.Action, Genre.Simulation }, PlayMode.Both, 64, 4.7, DateTime.Parse("08/12/2006"), 1)); Context.Games.Add(new GameUnit("IL-2 Sturmovik: Battle of Stalingrad", "Third generation entry in the IL-2 Sturmovik franchise, bringing a new engine with impressive details and unrivaled simulation models!", @"https://www.youtube.com/watch?v=9EttVIq9Pig", "", new List <Genre> { Genre.Action, Genre.Simulation }, PlayMode.Both, 128, 4.9, DateTime.Parse("19.11.2013"), 1)); Context.Games.Add(new GameUnit("Arma: Cold War Assault", "Originally released as \"Operation Flashpoint: Cold War Crisis\" before Codemasters and Bohemia Interactive split, this is a hardcore military simulator with thrilling action across vast battlefields.", "", "", new List <Genre> { Genre.Action, Genre.Simulation }, PlayMode.Both, 64, 5, DateTime.Parse("22.06.2001"), 2)); Context.Games.Add(new GameUnit("Hearts of Iron 4", "Glavni razlog zasto ovu aplikaciju nisam zavrsio prosle sedmice", "", "", new List <Genre> { Genre.Strategy }, PlayMode.Both, 32, 5, DateTime.Parse("06.06.2016"), 3)); Context.Games.Add(new GameUnit("S.T.A.L.K.E.R: Anomaly", "The best STALKER mod from the community, for the community - combines the maps from all three games into a single map allowing you to lose yourself to the charms of the Chernobyl Exclusion Zone", "", "", new List <Genre> { Genre.Action, Genre.Adventure }, PlayMode.Singleplayer, 1, 5, DateTime.Now, 4)); Context.SaveChanges(); } }
int s_TimeoutMax = 300; // 900 on private list servers public Master2Controller(GameListContext gameListContext, GameListModuleManager gameListModuleManager) { _gameListContext = gameListContext; _gameListModuleManager = gameListModuleManager; }