1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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, string timingId)
- // frameId, width, height, top, left, visible, animatable
- {
- base.sid = timingId;
- 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<Item> 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,sid);
- 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,sid);
- 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,sid);
- items = diagram.DrawElement();
-
- }
- if (items != null&& items.Count > 0)
- {
- items[0].uid = graphicFrame.suid;
- }
- }
- return items;
- }
-
-
-
- }
- }
|