Fixed ControllerSupportConverter.
This commit is contained in:
parent
655e00c2dc
commit
b1a14117e0
@ -45,7 +45,7 @@ namespace SteamStorefrontAPI.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converts a string to a ControllerSupport enum
|
// Converts a string to a ControllerSupport enum
|
||||||
internal class ControllerSupportConverter : JsonConverter
|
public class ControllerSupportConverter : JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanRead
|
public override bool CanRead
|
||||||
{
|
{
|
||||||
@ -59,13 +59,11 @@ namespace SteamStorefrontAPI.Classes
|
|||||||
if (reader.TokenType == JsonToken.Null) return null;
|
if (reader.TokenType == JsonToken.Null) return null;
|
||||||
var value = serializer.Deserialize<string>(reader);
|
var value = serializer.Deserialize<string>(reader);
|
||||||
|
|
||||||
ControllerSupport convertedValue;
|
if (Enum.TryParse(value, true, out ControllerSupport convertedValue))
|
||||||
if(Enum.TryParse(value, out convertedValue))
|
|
||||||
{
|
{
|
||||||
return convertedValue;
|
return convertedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: fix the controller converter
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +74,7 @@ namespace SteamStorefrontAPI.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Converts an epoch string to a datetime object
|
// Converts an epoch string to a datetime object
|
||||||
internal class EpochToDateTimeConverter : JsonConverter
|
public class EpochToDateTimeConverter : JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanRead
|
public override bool CanRead
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user