HtexGroupShape.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using HTEXLib.Helpers.ShapeHelpers;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace HTEXLib.Models.HTEX
  6. {
  7. public class HtexGroupShape : HtexElement
  8. {
  9. public HtexGroupShape(string id, double rot, double width, double height,
  10. double top, double left, bool invisible,
  11. bool animatable, int index, Inner.PPTGroupShape groupShape, PPTSlide slide, string partForm)
  12. {
  13. base.slide = slide;
  14. this.rot = rot;
  15. this.groupShape = groupShape;
  16. base.id = id;
  17. base.top = top;
  18. base.left = left;
  19. base.width = width;
  20. base.height = height;
  21. base.invisible = invisible;
  22. base.animatable = animatable;
  23. base.index = index;
  24. base.type = "Group";
  25. base.partForm = partForm;
  26. }
  27. public Inner.PPTGroupShape groupShape { get; set; }
  28. public override List<Item> DrawElement()
  29. {
  30. Position position = new Position { cx = width, cy = height, x = left, y = top, rot = rot };
  31. var ShapeStyle = PPTXHelper.DoShapeProperties(groupShape.element.GroupShapeProperties, slide, type, partForm);
  32. Group group = new Group() { id = this.id, type = type, index = index, animatable = animatable, invisible = invisible };
  33. group.style.border = ShapeStyle.border;
  34. group.style.fill = ShapeStyle.fill;
  35. group.style.position = position;
  36. group.uid = groupShape.suid;
  37. //SlideColor slideColor = PPTXHelper.DoShapeStyle(groupShape.element.ShapeStyle, slide, type);
  38. HtexSlide htexSlide = new HtexSlide(slide, slide.slideIndex)
  39. {
  40. ContainerShape = groupShape.containerShape,
  41. FromGroup = true
  42. };
  43. var elements= htexSlide.DrawElement();
  44. if (elements != null) {
  45. group.shapes = elements;
  46. }
  47. return new List<Item>() { group };
  48. }
  49. }
  50. }