public EditGameFlyoutViewModel( IDialogManager dialogManager, IEventAggregator events, IRepository <ArenaSession> arenaRepository, IRepository <GameResult> gameRepository, IDeckManager deckManager, GameManager.GameManager gameManager) { this.dialogManager = dialogManager; this.events = events; this.arenaRepository = arenaRepository; this.gameRepository = gameRepository; this.deckManager = deckManager; this.gameManager = gameManager; Name = Flyouts.EditGame; Header = displayName_new; SetPosition(Position.Right); heroes = new BindableCollection <Hero>(); events.Subscribe(this); GameMode = GameMode.Practice; StartTime = DateTime.Now; EndTime = DateTime.Now; PropertyChanged += OnPropertyChanged; lastIsOpen = IsOpen; // yeah lol :p gameModes.Remove(GameMode.Arena); selectedServer = servers.Default; Busy = new BusyWatcher(); }
public DeckSettingsViewModel( IEventAggregator events, IDeckManager deckManager) { this.events = events; this.deckManager = deckManager; SetPosition(Position.Left); Name = Flyouts.Decks; Header = DisplayName = "Decks:"; // note the setting of backing field instead of property, to not trigger deck refreshing yet. selectedServer = servers.Default ?? servers.First(); events.Subscribe(this); CanTakeScreenshot = true; }
private void SetMissingServer(ServerItemModel selectedServer) { if (selectedServer == null) { return; } var serverName = selectedServer.Name; using (var context = dbContext()) { context.Database.ExecuteSqlCommand("UPDATE GameResults SET Server = @p0 WHERE Server IS NULL OR Server = ''", serverName); context.Database.ExecuteSqlCommand("UPDATE ArenaSessions SET Server = @p0 WHERE Server IS NULL OR Server = ''", serverName); } events.PublishOnBackgroundThread(new RefreshAll()); }
public ServerChanged(ServerItemModel server) { this.Server = server; }
public void ChangeServer(ServerItemModel server) { servers.Default = server; server.IsChecked = true; }