-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathPropertyModel.cs
71 lines (61 loc) · 2.17 KB
/
PropertyModel.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
using System;
using System.Collections.Generic;
namespace Umbraco.ModelsBuilder.Building
{
/// <summary>
/// Represents a model property.
/// </summary>
public class PropertyModel
{
/// <summary>
/// Gets the alias of the property.
/// </summary>
public string Alias;
/// <summary>
/// Gets the name of the property.
/// </summary>
public string Name;
/// <summary>
/// Gets the description of the property.
/// </summary>
public string Description;
/// <summary>
/// Gets the clr name of the property.
/// </summary>
/// <remarks>This is just the local name eg "Price".</remarks>
public string ClrName;
/// <summary>
/// Gets the Model Clr type of the property values.
/// </summary>
/// <remarks>As indicated by the <c>PublishedPropertyType</c>, ie by the <c>IPropertyValueConverter</c>
/// if any, else <c>object</c>. May include some ModelType that will need to be mapped.</remarks>
public Type ModelClrType;
/// <summary>
/// Gets the CLR type name of the property values.
/// </summary>
public string ClrTypeName;
/// <summary>
/// Gets a value indicating whether this property should be excluded from generation.
/// </summary>
public bool IsIgnored;
/// <summary>
/// Gets a value indicating whether this property allows varying by Culture.
/// </summary>
public bool IsCultureVariant;
/// <summary>
/// Gets the generation errors for the property.
/// </summary>
/// <remarks>This should be null, unless something prevents the property from being
/// generated, and then the value should explain what. This can be used to generate
/// commented out code eg in PureLive.</remarks>
public List<string> Errors;
/// <summary>
/// Adds an error.
/// </summary>
public void AddError(string error)
{
if (Errors == null) Errors = new List<string>();
Errors.Add(error);
}
}
}