using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace InABox.Core
{
public class ExpressionEditor : BaseEditor
{
///
/// The to use for this expression; if set to null, the variables must be manually set for the editor.
///
public Type? ModelType { get; set; }
[DoNotSerialize]
[JsonIgnore]
public List? VariableNames { get; set; }
public ExpressionEditor(Type? modelType)
{
if (modelType != null && !typeof(IExpressionModel).IsAssignableFrom(modelType))
throw new Exception($"Expression type must be a {nameof(IExpressionModel)}");
ModelType = modelType;
}
protected override BaseEditor DoClone()
{
return new ExpressionEditor(ModelType);
}
}
}