|
@@ -1,10 +1,11 @@
|
|
|
using System.Collections;
|
|
|
+using PixiEditor.Localization;
|
|
|
|
|
|
namespace PixiEditor.Helpers.Collections;
|
|
|
|
|
|
-public class ActionDisplayList : IEnumerable<KeyValuePair<string, string>>
|
|
|
+public class ActionDisplayList : IEnumerable<KeyValuePair<string, LocalizedString>>
|
|
|
{
|
|
|
- private Dictionary<string, string> _dictionary = new();
|
|
|
+ private Dictionary<string, LocalizedString> _dictionary = new();
|
|
|
private Action notifyUpdate;
|
|
|
|
|
|
public ActionDisplayList(Action notifyUpdate)
|
|
@@ -12,7 +13,7 @@ public class ActionDisplayList : IEnumerable<KeyValuePair<string, string>>
|
|
|
this.notifyUpdate = notifyUpdate;
|
|
|
}
|
|
|
|
|
|
- public string this[string key]
|
|
|
+ public LocalizedString? this[string key]
|
|
|
{
|
|
|
get => _dictionary[key];
|
|
|
set
|
|
@@ -24,16 +25,16 @@ public class ActionDisplayList : IEnumerable<KeyValuePair<string, string>>
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- _dictionary[key] = value;
|
|
|
+ _dictionary[key] = value.Value;
|
|
|
notifyUpdate();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public string GetActive() => _dictionary.Last().Value;
|
|
|
+ public LocalizedString GetActive() => _dictionary.Last().Value;
|
|
|
|
|
|
public bool HasActive() => _dictionary.Count != 0;
|
|
|
|
|
|
- public IEnumerator<KeyValuePair<string, string>> GetEnumerator() => _dictionary.GetEnumerator();
|
|
|
+ public IEnumerator<KeyValuePair<string, LocalizedString>> GetEnumerator() => _dictionary.GetEnumerator();
|
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator() => _dictionary.GetEnumerator();
|
|
|
}
|