Rename Memory to MemoryBlocks
This commit is contained in:
parent
951149b5d4
commit
1fc93afcb2
|
|
@ -8,17 +8,17 @@ public class MemoryRegister
|
|||
public MemoryRegister(MemoryRegister? parent = default, IDictionary<string, MemoryBlock>? locations = default)
|
||||
{
|
||||
Parent = parent;
|
||||
Memory = locations ?? new Dictionary<string, MemoryBlock>();
|
||||
MemoryBlocks = locations ?? new Dictionary<string, MemoryBlock>();
|
||||
}
|
||||
|
||||
public MemoryRegister? Parent { get; }
|
||||
public IDictionary<string, MemoryBlock> Memory { get; }
|
||||
public IDictionary<string, MemoryBlock> MemoryBlocks { get; }
|
||||
|
||||
public bool TryGetMemoryDatum(string id, out MemoryBlock datum)
|
||||
{
|
||||
datum = null!;
|
||||
|
||||
if (Memory.TryGetValue(id, out datum!))
|
||||
if (MemoryBlocks.TryGetValue(id, out datum!))
|
||||
return true;
|
||||
|
||||
return Parent?.TryGetMemoryDatum(id, out datum) == true;
|
||||
|
|
@ -33,7 +33,7 @@ public class MemoryRegister
|
|||
public MemoryBlock Declare(MemoryReference reference)
|
||||
{
|
||||
var datum = reference.Declare();
|
||||
Memory[reference.Id] = datum;
|
||||
MemoryBlocks[reference.Id] = datum;
|
||||
return datum;
|
||||
}
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ namespace Elsa.JavaScript.Implementations
|
|||
|
||||
while (currentContext != null)
|
||||
{
|
||||
foreach (var l in currentContext.MemoryRegister.Memory)
|
||||
foreach (var l in currentContext.MemoryRegister.MemoryBlocks)
|
||||
{
|
||||
if(!dictionary.ContainsKey(l.Key))
|
||||
dictionary.Add(l.Key, l.Value);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class WorkflowStateSerializer : IWorkflowStateSerializer
|
|||
{
|
||||
ActivityExecutionContextState CreateActivityExecutionContextState(ActivityExecutionContext activityExecutionContext)
|
||||
{
|
||||
var registerState = new RegisterState(activityExecutionContext.ExpressionExecutionContext.MemoryRegister.Memory);
|
||||
var registerState = new RegisterState(activityExecutionContext.ExpressionExecutionContext.MemoryRegister.MemoryBlocks);
|
||||
var activityExecutionContextState = new ActivityExecutionContextState
|
||||
{
|
||||
Id = activityExecutionContext.Id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue