Ejemplo n.º 1
0
 /// <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
 }
Ejemplo n.º 2
0
 /// <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
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 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()
     });
Ejemplo n.º 6
0
        /// <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
        }
Ejemplo n.º 7
0
 public MasterOLEObject(SCSlideMaster slideMaster, P.GraphicFrame pGraphicFrame) : base(slideMaster,
                                                                                        pGraphicFrame)
 {
 }
Ejemplo n.º 8
0
 /// <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());
 }
Ejemplo n.º 9
0
 internal MasterTable(SCSlideMaster slideMaster, P.GraphicFrame pGraphicFrame)
     : base(slideMaster, pGraphicFrame)
 {
 }
Ejemplo n.º 10
0
 public static A.Table GetATable(this P.GraphicFrame pGraphicFrame)
 {
     return(pGraphicFrame.GetFirstChild <A.Graphic>().GraphicData.GetFirstChild <A.Table>());
 }
Ejemplo n.º 11
0
 public LayoutChart(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame) : base(slideLayout, pGraphicFrame)
 {
 }
Ejemplo n.º 12
0
 internal LayoutOLEObject(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame)
     : base(slideLayout, pGraphicFrame)
 {
 }
Ejemplo n.º 13
0
        /// <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));
        }
Ejemplo n.º 14
0
 public ChartEx(P.GraphicFrame grFrame, IShapeContext shapeContext)
     : this(grFrame, shapeContext, new ChartRefParser(shapeContext))
 {
 }
Ejemplo n.º 15
0
 internal MasterChart(SCSlideMaster slideMaster, P.GraphicFrame pGraphicFrame)
     : base(slideMaster, pGraphicFrame)
 {
 }
Ejemplo n.º 16
0
 internal LayoutTable(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame)
     : base(slideLayout, pGraphicFrame)
 {
 }