C00225155-02/C00225155/MegaRobo.C00225155/MegaRobo.C00225155.ControlD.../TemperatureControl/ParseResult.cs

39 lines
1016 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MegaRobo.C00225155.ControlDevices
{
/// <summary>
/// 解析结果封装(包含成功状态、描述、数据)
/// </summary>
public class ParseResult
{
/// <summary>
/// 解析是否成功
/// </summary>
public bool IsSuccess { get; }
/// <summary>
/// 解析描述(成功/失败原因)
/// </summary>
public string Description { get; }
/// <summary>
/// 解析后的数据Key-Value结构根据指令类型不同内容不同
/// </summary>
public Dictionary<string, object> Data { get; }
public ParseResult(bool isSuccess, string description, Dictionary<string, object> data)
{
IsSuccess = isSuccess;
Description = description;
Data = data ?? new Dictionary<string, object>();
}
}
}