2020-06-14 18:54:14 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
2020-11-27 13:13:26 +08:00
|
|
|
|
#pragma warning disable 1591 // Disable missing XML comment
|
|
|
|
|
|
|
|
|
|
namespace AntDesign.Select.Internal
|
2020-06-14 18:54:14 +08:00
|
|
|
|
{
|
2020-11-27 13:13:26 +08:00
|
|
|
|
internal static class SelectModeExtensions
|
2020-06-14 18:54:14 +08:00
|
|
|
|
{
|
2020-11-27 13:13:26 +08:00
|
|
|
|
internal const string Tags = "tags";
|
|
|
|
|
internal const string Multiple = "multiple";
|
2020-06-14 18:54:14 +08:00
|
|
|
|
private const StringComparison Comparison = StringComparison.OrdinalIgnoreCase;
|
|
|
|
|
|
2020-11-27 13:13:26 +08:00
|
|
|
|
internal static SelectMode ToSelectMode(this string mode)
|
2020-06-14 18:54:14 +08:00
|
|
|
|
{
|
|
|
|
|
if (Tags.Equals(mode, Comparison))
|
|
|
|
|
{
|
|
|
|
|
return SelectMode.Tags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Multiple.Equals(mode, Comparison) ? SelectMode.Multiple : SelectMode.Default;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|