ExpressionEditor.cs 596 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace InABox.Core
  5. {
  6. public class ExpressionEditor : BaseEditor
  7. {
  8. public Type EntityType { get; set; }
  9. public ExpressionEditor(Type entityType)
  10. {
  11. if (!typeof(IExpressionModel).IsAssignableFrom(entityType))
  12. throw new Exception($"Expression type must be a {nameof(IExpressionModel)}");
  13. EntityType = entityType;
  14. }
  15. protected override BaseEditor DoClone()
  16. {
  17. return new ExpressionEditor(EntityType);
  18. }
  19. }
  20. }