/// <summary> /// Initializes a new instance of the <see cref="ChartEx"/> class. /// </summary> public ChartEx(P.GraphicFrame grFrame, IShapeContext shapeContext) { _grFrame = grFrame ?? throw new ArgumentNullException(nameof(grFrame)); _shapeContext = shapeContext ?? throw new ArgumentNullException(nameof(shapeContext)); _chartType = new Lazy <ChartType>(GetChartType); Init(); //TODO: convert to lazy loading }
/// <summary> /// Initializes a new instance of the <see cref="ChartEx"/> class. /// </summary> public ChartEx(P.GraphicFrame grFrame, IShapeContext shapeContext) { _grFrame = grFrame ?? throw new ArgumentNullException(nameof(grFrame)); _shapeContext = shapeContext ?? throw new ArgumentNullException(nameof(shapeContext)); _chartType = new Lazy <ChartType>(GetChartType); _firstSeries = new Lazy <OpenXmlElement>(GetFirstSeries); _xValues = new Lazy <LibraryCollection <double> >(TryGetXValues); Init(); //TODO: convert to lazy loading }
internal static RowCollection Create(SlideTable table, P.GraphicFrame pGraphicFrame) { IEnumerable <A.TableRow> aTableRows = pGraphicFrame.GetATable().Elements <A.TableRow>(); var rowList = new List <SCTableRow>(aTableRows.Count()); int rowIndex = 0; rowList.AddRange(aTableRows.Select(aTblRow => new SCTableRow(table, aTblRow, rowIndex++))); return(new RowCollection(rowList)); }
internal SlideTable( OpenXmlCompositeElement pShapeTreeChild, ILocation innerTransform, ShapeContext spContext, SCSlide slide) : base(slide, pShapeTreeChild) { this.innerTransform = innerTransform; Context = spContext; rowCollection = new ResettableLazy <RowCollection>(() => RowCollection.Create(this, (P.GraphicFrame)PShapeTreeChild)); pGraphicFrame = pShapeTreeChild as P.GraphicFrame; }
public static P.NonVisualDrawingProperties GetNonVisualDrawingProperties( this OpenXmlCompositeElement compositeElement) { // Get <p:cNvSpPr> return(compositeElement switch { P.GraphicFrame pGraphicFrame => pGraphicFrame.NonVisualGraphicFrameProperties .NonVisualDrawingProperties, P.Shape pShape => pShape.NonVisualShapeProperties.NonVisualDrawingProperties, P.Picture pPicture => pPicture.NonVisualPictureProperties.NonVisualDrawingProperties, P.GroupShape pGroupShape => pGroupShape.NonVisualGroupShapeProperties.NonVisualDrawingProperties, _ => throw new ShapeCrawlerException() });
/// <summary> /// Initializes a new instance of the <see cref="SlideChart" /> class. /// </summary> internal SlideChart(P.GraphicFrame pGraphicFrame, SCSlide slide) : base(slide, pGraphicFrame) { _pGraphicFrame = pGraphicFrame; _firstSeries = new Lazy <OpenXmlElement>(GetFirstSeries); _xValues = new Lazy <LibraryCollection <double> >(GetXValues); _seriesCollection = new Lazy <SeriesCollection>(() => Collections.SeriesCollection.Create(this, _cXCharts)); _categories = new Lazy <CategoryCollection>(() => CategoryCollection.Create(this, _firstSeries.Value, Type)); _chartType = new Lazy <ChartType>(GetChartType); ChartWorkbook = new ChartWorkbook(this); Init(); //TODO: convert to lazy loading }
public MasterOLEObject(SCSlideMaster slideMaster, P.GraphicFrame pGraphicFrame) : base(slideMaster, pGraphicFrame) { }
/// <summary> /// Initializes an instance of the <see cref="TableEx"/> class. /// </summary> public TableEx(P.GraphicFrame xmlGrFrame, IShapeContext spContext) { _sdkGrFrame = xmlGrFrame ?? throw new ArgumentNullException(nameof(xmlGrFrame)); _spContext = spContext ?? throw new ArgumentNullException(nameof(spContext)); _rowsCollection = new Lazy <RowsCollection>(GetRowsCollection()); }
internal MasterTable(SCSlideMaster slideMaster, P.GraphicFrame pGraphicFrame) : base(slideMaster, pGraphicFrame) { }
public static A.Table GetATable(this P.GraphicFrame pGraphicFrame) { return(pGraphicFrame.GetFirstChild <A.Graphic>().GraphicData.GetFirstChild <A.Table>()); }
public LayoutChart(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame) : base(slideLayout, pGraphicFrame) { }
internal LayoutOLEObject(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame) : base(slideLayout, pGraphicFrame) { }
/// <summary> /// Has <see cref="P.GraphicFrame"/> instance chart. /// </summary> /// <param name="grFrame"></param> public static bool HasChart(this P.GraphicFrame grFrame) { var grData = grFrame.GetFirstChild <A.Graphic>().GetFirstChild <A.GraphicData>(); return(grData.Uri.Value.Equals(ChartUri, StringComparison.Ordinal)); }
public ChartEx(P.GraphicFrame grFrame, IShapeContext shapeContext) : this(grFrame, shapeContext, new ChartRefParser(shapeContext)) { }
internal MasterChart(SCSlideMaster slideMaster, P.GraphicFrame pGraphicFrame) : base(slideMaster, pGraphicFrame) { }
internal LayoutTable(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame) : base(slideLayout, pGraphicFrame) { }