예제 #1
0
        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);
        }
예제 #2
0
 public void DeleteGamePad(int id)
 {
     CustomGamePads.Remove(id);
     SaveChanges();
 }