2021-07-26 13:16:19 +08:00
|
|
|
|
// Licensed to the .NET Foundation under one or more agreements.
|
|
|
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
|
|
namespace AntDesign
|
|
|
|
|
{
|
|
|
|
|
public class EnumSelect<TEnum> : Select<TEnum, TEnum>
|
|
|
|
|
{
|
|
|
|
|
public EnumSelect()
|
|
|
|
|
{
|
2021-07-27 13:43:23 +08:00
|
|
|
|
if (THelper.GetUnderlyingType<TEnum>().IsEnum)
|
2021-07-26 13:16:19 +08:00
|
|
|
|
{
|
|
|
|
|
DataSource = EnumHelper<TEnum>.GetValueList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string GetLabel(TEnum item)
|
|
|
|
|
{
|
|
|
|
|
return EnumHelper<TEnum>.GetDisplayName(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|