/
NodeAttribute.cs
85 lines (70 loc) · 2.06 KB
/
NodeAttribute.cs
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
namespace Artemis.Core;
/// <summary>
/// Represents an attribute that can be used to provide metadata on a node
/// </summary>
public class NodeAttribute : Attribute
{
#region Properties & Fields
/// <summary>
/// Gets the name of the node
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the description of the node
/// </summary>
public string Description { get; } = string.Empty;
/// <summary>
/// Gets the category of the node
/// </summary>
public string Category { get; } = string.Empty;
/// <summary>
/// Gets the help URL of the node
/// </summary>
public string HelpUrl { get; init; } = string.Empty;
/// <summary>
/// Gets the primary input type of the node
/// </summary>
public Type? InputType { get; init; }
/// <summary>
/// Gets the primary output type of the node
/// </summary>
public Type? OutputType { get; init; }
#endregion
#region Constructors
/// <summary>
/// Creates a new instance of the <see cref="NodeAttribute" /> class
/// </summary>
public NodeAttribute(string name)
{
Name = name;
}
/// <summary>
/// Creates a new instance of the <see cref="NodeAttribute" /> class
/// </summary>
public NodeAttribute(string name, string description)
{
Name = name;
Description = description;
}
/// <summary>
/// Creates a new instance of the <see cref="NodeAttribute" /> class
/// </summary>
public NodeAttribute(string name, string description, string category)
{
Name = name;
Description = description;
Category = category;
}
/// <summary>
/// Creates a new instance of the <see cref="NodeAttribute" /> class
/// </summary>
public NodeAttribute(string name, string description, string category, string helpUrl)
{
Name = name;
Description = description;
Category = category;
HelpUrl = helpUrl;
}
#endregion
}