port from perforce
This commit is contained in:
28
intromat/Intromat/Nodes/Code/LiteralValueBase.cs
Normal file
28
intromat/Intromat/Nodes/Code/LiteralValueBase.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Text;
|
||||
using Intromat.Model.Compiler;
|
||||
|
||||
namespace Intromat.Nodes.Code
|
||||
{
|
||||
public abstract class LiteralValueBase<T> : ITypedExpression<T>
|
||||
{
|
||||
public virtual string? PreviewValue => Value?.ToString();
|
||||
|
||||
public T ParentValue { get; set; } = default!;
|
||||
|
||||
public T InputValue { get; set; } = default!;
|
||||
|
||||
public T Value { get; set; } = default!;
|
||||
|
||||
public ERelativeSource RelativeSource { get; set; }
|
||||
|
||||
public virtual void Compile(CompilerContext context, StringBuilder sb)
|
||||
{
|
||||
sb.Append(Value);
|
||||
}
|
||||
|
||||
public virtual T Evaluate()
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user