| | | 1 | | using CShells.Features; |
| | | 2 | | using Elsa.Extensions; |
| | | 3 | | using Elsa.Workflows.Activities.Flowchart.Options; |
| | | 4 | | using Elsa.Workflows.Activities.Flowchart.Serialization; |
| | | 5 | | using JetBrains.Annotations; |
| | | 6 | | using Microsoft.Extensions.DependencyInjection; |
| | | 7 | | |
| | | 8 | | namespace Elsa.Workflows.ShellFeatures; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Adds support for the Flowchart activity. |
| | | 12 | | /// </summary> |
| | | 13 | | [ShellFeature( |
| | | 14 | | DisplayName = "Flowchart", |
| | | 15 | | Description = "Adds support for the Flowchart activity")] |
| | | 16 | | [UsedImplicitly] |
| | | 17 | | public class FlowchartFeature : IShellFeature |
| | | 18 | | { |
| | | 19 | | /// <summary> |
| | | 20 | | /// A delegate to configure <see cref="FlowchartOptions"/>. |
| | | 21 | | /// </summary> |
| | 0 | 22 | | public Action<FlowchartOptions>? FlowchartOptionsConfigurator { get; set; } |
| | | 23 | | |
| | | 24 | | public void ConfigureServices(IServiceCollection services) |
| | | 25 | | { |
| | 0 | 26 | | services.AddSerializationOptionsConfigurator<FlowchartSerializationOptionConfigurator>(); |
| | | 27 | | |
| | | 28 | | // Register FlowchartOptions |
| | 0 | 29 | | services.AddOptions<FlowchartOptions>(); |
| | | 30 | | |
| | 0 | 31 | | if (FlowchartOptionsConfigurator != null) |
| | 0 | 32 | | services.Configure(FlowchartOptionsConfigurator); |
| | 0 | 33 | | } |
| | | 34 | | } |
| | | 35 | | |