ExtendAttribute.cs
1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Rcs.Domain.Entities;
namespace Rcs.Domain.Extensions
{
/// <summary>
/// 用于标注协议名称和版本的特性
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public sealed class ProtocolInfoAttribute : Attribute
{
/// <summary>
/// 协议名称
/// </summary>
public string Manufacturer { get; }
/// <summary>
/// 协议版本
/// </summary>
public string Version { get; }
/// <summary>
/// 协议主题
/// </summary>
public string Topic { get; set; }
/// <summary>
/// 设备类型
/// </summary>
public RobotType RobotType { get; set; }
public ProtocolInfoAttribute(string protocolName, string version, string topic, RobotType robotType = RobotType.Forklift)
{
Manufacturer = protocolName;
Version = version;
Topic = topic;
RobotType = robotType;
}
}
}