-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttributesIndex.cs
More file actions
48 lines (44 loc) · 1.93 KB
/
Copy pathAttributesIndex.cs
File metadata and controls
48 lines (44 loc) · 1.93 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
38
39
40
41
42
43
44
45
46
47
48
using System.Collections.Generic;
using Newtonsoft.Json;
namespace NETMetaCoder.MSBuild
{
/// <summary>
/// A type that represents the expected JSON format in an attributes index file.
///
/// The attributes index file maps attribute names to wrapper types, along with metadata.
///
/// These attribute names must match the attribute names used on methods which are expected to be wrapped by
/// <c>NETMetaCoder</c>'s generated code.
/// </summary>
public sealed class AttributesIndex
{
/// <summary>
/// The collection of <see cref="Attribute"/> as expected to be found in the attributes index file.
/// </summary>
[JsonProperty("attributes", Required = Required.Always)]
public IEnumerable<Attribute> Attributes { get; set; }
/// <summary>
/// The type representing a single attribute description, as expected to be found in the attributes index file.
/// </summary>
public sealed class Attribute
{
/// <summary>
/// The attribute name, as it is expected to match in the code that is being rewritten.
/// </summary>
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
/// <summary>
/// The order with which to wrap the code, as defined by this attribute's <see cref="Wrapper"/>.
///
/// This has an effect only when target multiple attributes the generate wrapper code.
/// </summary>
[JsonProperty("order", Required = Required.Always)]
public int Order { get; set; }
/// <summary>
/// The name of the wrapper code which defines how the wrapper syntax will be generated for this attribute.
/// </summary>
[JsonProperty("wrapper", Required = Required.Always)]
public string Wrapper { get; set; }
}
}
}