mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-01 14:20:05 +01:00
33 lines
943 B
C#
33 lines
943 B
C#
using System.ComponentModel;
|
|
using System.Globalization;
|
|
|
|
namespace SteamController.ProfilesSettings.Helpers
|
|
{
|
|
internal class ProfileStringConverter : TypeConverter
|
|
{
|
|
public static string[] Profiles = new string[0];
|
|
|
|
private volatile StandardValuesCollection? collection;
|
|
|
|
public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext? context)
|
|
{
|
|
return collection ??= new StandardValuesCollection(Profiles.ToArray());
|
|
}
|
|
|
|
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override bool IsValid(ITypeDescriptorContext? context, object? value)
|
|
{
|
|
return Profiles.Contains(value?.ToString());
|
|
}
|
|
}
|
|
}
|