HtexGroupShape.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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, string timingId)
  12. {
  13. base.sid = timingId;
  14. base.slide = slide;
  15. this.rot = rot;
  16. this.groupShape = groupShape;
  17. base.id = id;
  18. base.top = top;
  19. base.left = left;
  20. base.width = width;
  21. base.height = height;
  22. base.invisible = invisible;
  23. base.animatable = animatable;
  24. base.index = index;
  25. base.type = "Group";
  26. base.partForm = partForm;
  27. }
  28. public Inner.PPTGroupShape groupShape { get; set; }
  29. public override List<Item> DrawElement()
  30. {
  31. Position position = new Position { cx = width, cy = height, x = left, y = top, rot = rot };
  32. var ShapeStyle = PPTXHelper.DoShapeProperties(groupShape.element.GroupShapeProperties, slide, type, partForm);
  33. Group group = new Group() { sid = sid,id = this.id, type = type, index = index, animatable = animatable, invisible = invisible };
  34. group.style.border = ShapeStyle.border;
  35. group.style.fill = ShapeStyle.fill;
  36. group.style.position = position;
  37. group.uid = groupShape.suid;
  38. //SlideColor slideColor = PPTXHelper.DoShapeStyle(groupShape.element.ShapeStyle, slide, type);
  39. HtexSlide htexSlide = new HtexSlide(slide, slide.slideIndex)
  40. {
  41. ContainerShape = groupShape.containerShape,
  42. FromGroup = true
  43. };
  44. var elements= htexSlide.DrawElement();
  45. if (elements != null) {
  46. group.shapes = elements;
  47. }
  48. return new List<Item>() { group };
  49. }
  50. }
  51. }