Add project files.

This commit is contained in:
2025-08-18 17:11:43 +03:30
parent 807dc263be
commit e5eb10d604
3943 changed files with 223719 additions and 0 deletions
@@ -0,0 +1,56 @@
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
using Elsa.Expressions.Models;
using Elsa.Extensions;
using Elsa.Testing.Shared.Services;
using Elsa.Workflows.Memory;
using Elsa.Workflows.Models;
namespace Elsa.Workflows.ComponentTests.Activities;
public class TriggerSignal : CodeActivity
{
/// <inheritdoc />
[JsonConstructor]
private TriggerSignal(string? source = null, int? line = null) : base(source, line)
{
}
/// <inheritdoc />
public TriggerSignal(string eventName, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : this(new Literal<string>(eventName), source, line)
{
}
/// <inheritdoc />
public TriggerSignal(Func<string> eventName, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null)
: this(Expression.DelegateExpression(eventName), source, line)
{
}
/// <inheritdoc />
public TriggerSignal(Func<ExpressionExecutionContext, string?> eventName, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null)
: this(Expression.DelegateExpression(eventName), source, line)
{
}
/// <inheritdoc />
public TriggerSignal(Variable<string> variable, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : this(source, line) => EventName = new Input<string>(variable);
/// <inheritdoc />
public TriggerSignal(Literal<string> literal, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : this(source, line) => EventName = new Input<string>(literal);
/// <inheritdoc />
public TriggerSignal(Expression expression, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : this(source, line) => EventName = new Input<string>(expression, new MemoryBlockReference());
/// <inheritdoc />
public TriggerSignal(Input<string> eventName, [CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : this(source, line) => EventName = eventName;
public Input<string> EventName { get; set; }
protected override void Execute(ActivityExecutionContext context)
{
var testEventManager = context.GetRequiredService<SignalManager>();
var eventName = EventName.Get(context);
testEventManager.Trigger(eventName);
}
}