HtexGroupShape.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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() { 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. //SlideColor slideColor = PPTXHelper.DoShapeStyle(groupShape.element.ShapeStyle, slide, type);
  37. HtexSlide htexSlide = new HtexSlide(slide, slide.slideIndex)
  38. {
  39. ContainerShape = groupShape.containerShape,
  40. FromGroup = true
  41. };
  42. var elements= htexSlide.DrawElement();
  43. if (elements != null) {
  44. group.shapes = elements;
  45. }
  46. return new List<Item>() { group };
  47. }
  48. }
  49. }