public void ChangeGame(ModelGame oldGame, ModelGame newGame) { if (oldGame != null && newGame != null) { oldGame.Name = newGame.Name; oldGame.IconType = newGame.IconType; oldGame.PathIcon = newGame.PathIcon; oldGame.ItemPath = newGame.ItemPath; oldGame.StartUpParams = newGame.StartUpParams; oldGame.MouseClickCordX = newGame.MouseClickCordX; oldGame.MouseClickCordY = newGame.MouseClickCordY; oldGame.NameProcess = newGame.NameProcess; oldGame.FileMotion = newGame.FileMotion; oldGame.RunKey = newGame.RunKey; oldGame.AdditionalKey = newGame.AdditionalKey; oldGame.TimeOut = newGame.TimeOut; oldGame.StartTime = newGame.StartTime; oldGame.TypeStartFocus = newGame.TypeStartFocus; oldGame.ShiftPressTime = newGame.ShiftPressTime; oldGame.PathToBannerVideo = newGame.PathToBannerVideo; context.SaveChanges(); if (RefreshTableGames != null) { RefreshTableGames.Invoke(this, null); } return; } throw new Exception("Game not found"); }
public void AddGame(ModelGame game) { context.Games.Add(game); context.SaveChanges(); if (RefreshTableGames != null) { RefreshTableGames.Invoke(this, null); } }
public void DeleteGame(ModelGame game) { if (game != null) { context.Games.Remove(game); context.SaveChanges(); if (RefreshTableGames != null) { RefreshTableGames.Invoke(this, null); } return; } throw new Exception("Game not found"); }