mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Add global usings (#668)
* Use global usings * Fix namespace declarations for test projects
This commit is contained in:
@ -1,18 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
namespace Spectre.Console.Tests.Data;
|
||||
|
||||
namespace Spectre.Console.Tests.Data
|
||||
public sealed class StringToIntegerConverter : TypeConverter
|
||||
{
|
||||
public sealed class StringToIntegerConverter : TypeConverter
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
if (value is string stringValue)
|
||||
{
|
||||
if (value is string stringValue)
|
||||
{
|
||||
return int.Parse(stringValue, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
return int.Parse(stringValue, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user