ByteTransformHelperGetResultFromBytesTResult 方法 |
结果转换操作的基础方法,需要支持类型,及转换的委托,并捕获转换时的异常方法
命名空间:
HslCommunication.Core
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static OperateResult<TResult> GetResultFromBytes<TResult>(
OperateResult<byte[]> result,
Func<byte[], TResult> translator
)
Public Shared Function GetResultFromBytes(Of TResult) (
result As OperateResult(Of Byte()),
translator As Func(Of Byte(), TResult)
) As OperateResult(Of TResult)
public:
generic<typename TResult>
static OperateResult<TResult>^ GetResultFromBytes(
OperateResult<array<unsigned char>^>^ result,
Func<array<unsigned char>^, TResult>^ translator
)
static member GetResultFromBytes :
result : OperateResult<byte[]> *
translator : Func<byte[], 'TResult> -> OperateResult<'TResult>
参数
- result
- 类型:HslCommunicationOperateResultByte
源 - translator
- 类型:SystemFuncByte, TResult
实际转换的委托
类型参数
- TResult
- 结果类型
返回值
类型:
OperateResultTResult转换结果
参见