| | | 1 | | using System.Reflection; |
| | | 2 | | using System.Text.Json.Serialization; |
| | | 3 | | |
| | | 4 | | namespace Elsa.Workflows.Models; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// A base type for <see cref="InputDescriptor"/> and <see cref="OutputDescriptor"/>. |
| | | 8 | | /// </summary> |
| | | 9 | | public abstract class PropertyDescriptor |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// The name. |
| | | 13 | | /// </summary> |
| | 66422 | 14 | | public string Name { get; set; } = null!; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// The .NET type. |
| | | 18 | | /// </summary> |
| | | 19 | | [JsonPropertyName("typeName")] |
| | 22157 | 20 | | public Type Type { get; set; } = null!; |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// The user friendly name of the input. Used by UI tools. |
| | | 24 | | /// </summary> |
| | 22061 | 25 | | public string? DisplayName { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// The user friendly description of the input. Used by UI tools. |
| | | 29 | | /// </summary> |
| | 22061 | 30 | | public string? Description { get; set; } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// The order in which this input should be displayed by UI tools. |
| | | 34 | | /// </summary> |
| | 17337 | 35 | | public float Order { get; set; } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// True if this property should be displayed by UI tools, false otherwise. |
| | | 39 | | /// </summary> |
| | 43866 | 40 | | public bool? IsBrowsable { get; set; } = true; |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// True if this property can be serialized. |
| | | 44 | | /// </summary> |
| | 32408 | 45 | | public bool? IsSerializable { get; set; } |
| | | 46 | | |
| | | 47 | | /// <summary> |
| | | 48 | | /// True if this input property is synthetic, which means it does not exist physically on the activity's .NET type. |
| | | 49 | | /// </summary> |
| | 27443 | 50 | | public bool IsSynthetic { get; set; } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// Returns the value of the input property for the specified activity. |
| | | 54 | | /// </summary> |
| | | 55 | | [JsonIgnore] |
| | 43008 | 56 | | public Func<IActivity, object?> ValueGetter { get; set; } = null!; |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Sets the value of the input property for the specified activity. |
| | | 60 | | /// </summary> |
| | | 61 | | [JsonIgnore] |
| | 22070 | 62 | | public Action<IActivity, object?> ValueSetter { get; set; } = null!; |
| | | 63 | | |
| | | 64 | | /// <summary> |
| | | 65 | | /// The source of the property, if any. |
| | | 66 | | /// </summary> |
| | | 67 | | [JsonIgnore] |
| | 27747 | 68 | | public PropertyInfo? PropertyInfo { get; set; } |
| | | 69 | | } |