aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Models/CheatsList.cs
diff options
context:
space:
mode:
authorIsaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com>2023-12-25 05:57:14 +0000
committerGitHub <noreply@github.com>2023-12-25 06:57:14 +0100
commit19a949d0bf02fd5850d1222b2d51c3bc3e0e5670 (patch)
tree70b7358beaf07057053c84e67f5531a8fc523178 /src/Ryujinx.Ava/UI/Models/CheatsList.cs
parentfeec5ef7b354e92bff03a846285af6bf4b8fb491 (diff)
Ava UI: Fix crash when clicking on a cheat's name (#5860)
* Fix crash * Remove nullable * Hide BuildId for child nodes * Fix warning * Fix charset
Diffstat (limited to 'src/Ryujinx.Ava/UI/Models/CheatsList.cs')
-rw-r--r--src/Ryujinx.Ava/UI/Models/CheatsList.cs51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/Ryujinx.Ava/UI/Models/CheatsList.cs b/src/Ryujinx.Ava/UI/Models/CheatsList.cs
deleted file mode 100644
index abe8e4df..00000000
--- a/src/Ryujinx.Ava/UI/Models/CheatsList.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Linq;
-
-namespace Ryujinx.Ava.UI.Models
-{
- public class CheatsList : ObservableCollection<CheatModel>
- {
- public CheatsList(string buildId, string path)
- {
- BuildId = buildId;
- Path = path;
-
- CollectionChanged += CheatsList_CollectionChanged;
- }
-
- public string BuildId { get; }
- public string Path { get; }
-
- public bool IsEnabled
- {
- get
- {
- return this.ToList().TrueForAll(x => x.IsEnabled);
- }
- set
- {
- foreach (var cheat in this)
- {
- cheat.IsEnabled = value;
- }
-
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsEnabled)));
- }
- }
-
- private void CheatsList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- if (e.Action == NotifyCollectionChangedAction.Add)
- {
- (e.NewItems[0] as CheatModel).EnableToggled += Item_EnableToggled;
- }
- }
-
- private void Item_EnableToggled(object sender, bool e)
- {
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsEnabled)));
- }
- }
-}