ant-design-blazor/components/select/SelectModeExtensions.cs

22 lines
579 B
C#
Raw Normal View History

using System;
namespace AntDesign
{
public static class SelectModeExtensions
{
public const string Tags = "tags";
public const string Multiple = "multiple";
private const StringComparison Comparison = StringComparison.OrdinalIgnoreCase;
public static SelectMode ToSelectMode(this string mode)
{
if (Tags.Equals(mode, Comparison))
{
return SelectMode.Tags;
}
return Multiple.Equals(mode, Comparison) ? SelectMode.Multiple : SelectMode.Default;
}
}
}