mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-16 01:41:14 +08:00
b5afba7e56
Co-authored-by: James Yeung <shunjiey@hotmail.com>
23 lines
634 B
C#
23 lines
634 B
C#
// 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()
|
|
{
|
|
if (THelper.GetUnderlyingType<TEnum>().IsEnum)
|
|
{
|
|
DataSource = EnumHelper<TEnum>.GetValueList();
|
|
}
|
|
}
|
|
|
|
protected override string GetLabel(TEnum item)
|
|
{
|
|
return EnumHelper<TEnum>.GetDisplayName(item);
|
|
}
|
|
}
|
|
}
|