public GamePad SaveGamePad(GamePad gamePad) { var gamePadId = gamePad.Id; if (gamePadId > 0) { CustomGamePads[gamePad.Id] = gamePad; } else { gamePad.Id = CustomGamePads.Count > 0 ? CustomGamePads.Max(x => x.Key) + 1 : 1; CustomGamePads.Add(gamePadId, gamePad); } SaveChanges(); return(gamePad); }
public void DeleteGamePad(int id) { CustomGamePads.Remove(id); SaveChanges(); }