DimensionsEditor.cs 810 B

12345678910111213141516171819202122232425262728293031
  1. using InABox.Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace Comal.Classes
  6. {
  7. public class DimensionsEditor : BaseEditor
  8. {
  9. public Type DimensionsType { get; set; }
  10. public bool AllowEditingUnit { get; set; } = true;
  11. public DimensionsEditor(Type dimensionsType)
  12. {
  13. if (!typeof(IDimensions).IsAssignableFrom(dimensionsType))
  14. {
  15. throw new ArgumentException("Type must be an IDimensions", nameof(dimensionsType));
  16. }
  17. DimensionsType = dimensionsType;
  18. }
  19. protected override BaseEditor DoClone()
  20. {
  21. return new DimensionsEditor(DimensionsType)
  22. {
  23. AllowEditingUnit = AllowEditingUnit
  24. };
  25. }
  26. }
  27. }