-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdapterOptions.cs
57 lines (51 loc) · 2.19 KB
/
AdapterOptions.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
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace DataCore.Adapter {
/// <summary>
/// Base class for runtime options for adapters deriving from <see cref="AdapterBase{TAdapterOptions}"/>.
/// </summary>
public class AdapterOptions {
/// <summary>
/// The adapter name. If <see langword="null"/> or white space, the adapter ID will be
/// used as the name.
/// </summary>
[MaxLength(
AdapterConstants.MaxNameLength,
ErrorMessageResourceName = nameof(AdapterOptionsResources.AdapterOptions_Name_MaxLength_Error),
ErrorMessageResourceType = typeof(AdapterOptionsResources))
]
[Display(
ResourceType = typeof(AdapterOptionsResources),
Name = nameof(AdapterOptionsResources.AdapterOptions_Name_DisplayName),
Description = nameof(AdapterOptionsResources.AdapterOptions_Name_Description),
Order = 0
)]
public string? Name { get; set; }
/// <summary>
/// The adapter description.
/// </summary>
[MaxLength(
AdapterConstants.MaxDescriptionLength,
ErrorMessageResourceName = nameof(AdapterOptionsResources.AdapterOptions_Description_MaxLength_Error),
ErrorMessageResourceType = typeof(AdapterOptionsResources))
]
[Display(
ResourceType = typeof(AdapterOptionsResources),
Name = nameof(AdapterOptionsResources.AdapterOptions_Description_DisplayName),
Description = nameof(AdapterOptionsResources.AdapterOptions_Description_Description),
Order = 1
)]
public string? Description { get; set; }
/// <summary>
/// A flag indicating if the adapter is enabled or not.
/// </summary>
[Display(
ResourceType = typeof(AdapterOptionsResources),
Name = nameof(AdapterOptionsResources.AdapterOptions_IsEnabled_DisplayName),
Description = nameof(AdapterOptionsResources.AdapterOptions_IsEnabled_Description),
Order = 2
)]
[DefaultValue(true)]
public bool IsEnabled { get; set; } = true;
}
}