SoftBasicGetEnumFromStringTEnum 方法 |
从字符串的枚举值数据转换成真实的枚举值数据
Convert enumeration value data from strings to real enumeration value data
命名空间:
HslCommunication.BasicFramework
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static TEnum GetEnumFromString<TEnum>(
string value
)
where TEnum : struct, new()
Public Shared Function GetEnumFromString(Of TEnum As {Structure, New}) (
value As String
) As TEnum
public:
generic<typename TEnum>
where TEnum : value class, gcnew()
static TEnum GetEnumFromString(
String^ value
)
static member GetEnumFromString :
value : string -> 'TEnum when 'TEnum : struct, new()
参数
- value
- 类型:SystemString
枚举的字符串的数据值
类型参数
- TEnum
- 枚举的类型值
返回值
类型:
TEnum真实的枚举值
示例
System.IO.FileMode fileMode = SoftBasic.GetEnumFromString<System.IO.FileMode>( "Append" );
if(fileMode == FileMode.Append)
{
}
参见