using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Drawing; using DocumentFormat.OpenXml.Drawing.Diagrams; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Presentation; using HTEXLib.Helpers.ShapeHelpers; using HTEXLib.Models.Inner; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; namespace HTEXLib.Models.HTEX { public class HtexGraphicFrame : HtexElement { public HtexGraphicFrame(string id, double rot, double width, double height, double top, double left, bool invisible, bool animatable, int index, Inner.PPTGraphicFrame graphicFrame, PPTSlide slide, string partForm) // frameId, width, height, top, left, visible, animatable { base.slide = slide; this.rot = rot; this.graphicFrame = graphicFrame; base.id = id; base.top = top; base.left = left; base.width = width; base.height = height; base.invisible = invisible; base.animatable = animatable; base.index = index; base.type = "GraphicFrame"; base.partForm = partForm; } public Inner.PPTGraphicFrame graphicFrame { get; set; } public override List DrawElement() { List < Item > items= null; var GraphicDataChildren = graphicFrame.element.Graphic.GraphicData.ChildElements; foreach (var clild in GraphicDataChildren) { if (clild is DocumentFormat.OpenXml.Drawing.Table Table) { HtexTable table = new HtexTable(id,rot,width,height,top,left,invisible,animatable,index,Table,slide,partForm); items= table.DrawElement(); } if (clild is DocumentFormat.OpenXml.Drawing.Charts.ChartReference Chart) { HtexChart chart = new HtexChart(id, rot, width, height, top, left, invisible, animatable, index, Chart, slide, partForm); items = chart.DrawElement(); } if (clild is DocumentFormat.OpenXml.Drawing.Diagrams.RelationshipIds Diagram) { HtexDiagram diagram = new HtexDiagram(id, rot, width, height, top, left, invisible, animatable, index, Diagram, slide, partForm); items = diagram.DrawElement(); } if (items != null&& items.Count > 0) { items[0].uid = graphicFrame.suid; } } return items; } } }