Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
coenm committed Apr 18, 2024
1 parent f3e325c commit 7a265c6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public UserInterfaceActionMenuFactory(

_contextActionMappers =
[
new ContextActionExecuteScriptV1Processor(),
new ContextActionSetVariableV1Processor(),
new ContextActionEvaluateVariableV1Processor(),
new ContextActionRenderVariableV1Processor(),
ContextActionExecuteScriptV1Processor.Instance,
ContextActionSetVariableV1Processor.Instance,
ContextActionEvaluateVariableV1Processor.Instance,
ContextActionRenderVariableV1Processor.Instance,
new ContextActionLoadFileV1Processor(_fileReader),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ namespace RepoM.ActionMenu.Core.Yaml.Model.ActionContext.EvaluateVariable;

internal class ContextActionEvaluateVariableV1Processor : ContextActionProcessorBase<ContextActionEvaluateVariableV1>
{
private ContextActionEvaluateVariableV1Processor()
{
}

public static ContextActionEvaluateVariableV1Processor Instance { get; } = new();

protected override async Task ProcessAsync(ContextActionEvaluateVariableV1 contextContextAction, IContextMenuActionMenuGenerationContext context, IScope scope)
{
object? result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ namespace RepoM.ActionMenu.Core.Yaml.Model.ActionContext.ExecuteScript;

internal class ContextActionExecuteScriptV1Processor : ContextActionProcessorBase<ContextActionExecuteScriptV1>
{
private ContextActionExecuteScriptV1Processor()
{
}

public static ContextActionExecuteScriptV1Processor Instance { get; } = new();

protected override async Task ProcessAsync(ContextActionExecuteScriptV1 contextAction, IContextMenuActionMenuGenerationContext context, IScope scope)
{
if (contextAction.Content == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace RepoM.ActionMenu.Core.Yaml.Model.ActionContext.RendererVariable;

internal class ContextActionRenderVariableV1Processor : ContextActionProcessorBase<ContextActionRenderVariableV1>
{
private ContextActionRenderVariableV1Processor()
{
}

public static ContextActionRenderVariableV1Processor Instance { get; } = new();

protected override async Task ProcessAsync(ContextActionRenderVariableV1 contextContextAction, IContextMenuActionMenuGenerationContext context, IScope scope)
{
string? result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ namespace RepoM.ActionMenu.Core.Yaml.Model.ActionContext.SetVariable;

internal class ContextActionSetVariableV1Processor : ContextActionProcessorBase<ContextActionSetVariableV1>
{
private ContextActionSetVariableV1Processor()
{
}

public static ContextActionSetVariableV1Processor Instance { get; } = new();

protected override Task ProcessAsync(ContextActionSetVariableV1 contextContextAction, IContextMenuActionMenuGenerationContext context, IScope scope)
{
scope.SetValue(contextContextAction.Name, contextContextAction.Value, false);
Expand Down

0 comments on commit 7a265c6

Please sign in to comment.