-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleAttributes.cs
More file actions
97 lines (87 loc) · 2.98 KB
/
ModuleAttributes.cs
File metadata and controls
97 lines (87 loc) · 2.98 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
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
86
87
88
89
90
91
92
93
94
95
96
97
using Modulight.Modules.Client.RazorComponents.UI;
namespace Modulight.Modules.Client.RazorComponents
{
/// <summary>
/// Specifies <see cref="IPageProvider.RootPath"/> for the razor component module.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class ModulePageRootPathAttribute : Attribute
{
/// <summary>
/// Specifies <see cref="IPageProvider.RootPath"/> for the razor component module.
/// </summary>
public ModulePageRootPathAttribute(string rootPath)
{
RootPath = rootPath;
}
/// <summary>
/// Root path.
/// </summary>
public string RootPath { get; }
}
/// <summary>
/// Specifies <see cref="RazorComponentClientModuleManifest.PageProvider"/> for the razor component module.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class ModulePageProviderAttribute : Attribute
{
/// <summary>
/// Specifies <see cref="RazorComponentClientModuleManifest.PageProvider"/> for the razor component module.
/// </summary>
public ModulePageProviderAttribute(Type type)
{
Type = type;
}
/// <summary>
/// Page provider.
/// </summary>
public Type Type { get; }
}
/// <summary>
/// Specifies <see cref="RazorComponentClientModuleManifest.GlobalComponents"/> for the razor component module.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public class ModuleUIGlobalComponentAttribute : Attribute
{
/// <summary>
/// Specifies <see cref="RazorComponentClientModuleManifest.GlobalComponents"/> for the razor component module.
/// </summary>
public ModuleUIGlobalComponentAttribute(Type type)
{
Type = type;
}
/// <summary>
/// Global component.
/// </summary>
public Type Type { get; }
}
/// <summary>
/// Specifies UI resources.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public class ModuleUIResourceAttribute : Attribute
{
/// <summary>
/// Specifies UI resources.
/// </summary>
/// <param name="type"></param>
/// <param name="path"></param>
public ModuleUIResourceAttribute(UIResourceType type, string path)
{
Type = type;
Path = path;
}
/// <summary>
/// Resource type.
/// </summary>
public UIResourceType Type { get; }
/// <summary>
/// Resource relative path.
/// </summary>
public string Path { get; } = string.Empty;
/// <summary>
/// Attributes for the resource.
/// </summary>
public string[] Attributes { get; init; } = Array.Empty<string>();
}
}