Beispiel #1
0
 public void DeleteCheat(NSWindow window)
 {
     if (CheatTableView.SelectedRow == -1)
     {
         var alert = new NSAlert
         {
             AlertStyle      = NSAlertStyle.Critical,
             InformativeText = NSBundle.MainBundle.LocalizedString("Please select the cheat to remove from the list of cheats.", null),
             MessageText     = NSBundle.MainBundle.LocalizedString("Delete Cheat", null),
         };
         alert.BeginSheet(window);
     }
     else
     {
         SelectedCheat = _cheats.GetItem <CheatModel>((nuint)CheatTableView.SelectedRow);
         var message = NSBundle.MainBundle.LocalizedString("Are you sure you want to delete cheat `{0:X}` from the table?", null);
         // Confirm delete
         var alert = new NSAlert
         {
             AlertStyle      = NSAlertStyle.Critical,
             InformativeText = string.Format(message, SelectedCheat.Address),
             MessageText     = NSBundle.MainBundle.LocalizedString("Delete Cheat", null),
         };
         alert.AddButton(NSBundle.MainBundle.LocalizedString("OK", null));
         alert.AddButton(NSBundle.MainBundle.LocalizedString("Cancel", null));
         alert.BeginSheetForResponse(window, (result) =>
         {
             // Delete?
             if (result == 1000)
             {
                 RemoveCheat(CheatTableView.SelectedRow);
             }
         });
     }
 }
Beispiel #2
0
 public void EditCheat(NSWindow window)
 {
     if (CheatTableView.SelectedRow == -1)
     {
         var alert = new NSAlert
         {
             AlertStyle      = NSAlertStyle.Informational,
             InformativeText = NSBundle.MainBundle.LocalizedString("Please select the cheat to edit from the list of cheats.", null),
             MessageText     = NSBundle.MainBundle.LocalizedString("Edit Cheat", null),
         };
         alert.BeginSheet(window);
     }
     else
     {
         SelectedCheat = _cheats.GetItem <CheatModel>((nuint)CheatTableView.SelectedRow);
         PerformSegue("EditorSegue", this);
     }
 }
Beispiel #3
0
 public void InsertCheat(CheatModel cheat, nint index)
 {
     WillChangeValue("cheatModelArray");
     _cheats.Insert(cheat, index);
     DidChangeValue("cheatModelArray");
 }
Beispiel #4
0
 public void AddCheat(CheatModel cheat)
 {
     WillChangeValue("cheatModelArray");
     _cheats.Add(cheat);
     DidChangeValue("cheatModelArray");
 }