DimensionsEditor.cs 990 B

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