DimensionsEditor.cs 789 B

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