コード例 #1
0
        public static string GetFillStyle <T>(IFillFormatEffectiveData format, TemplateContext <T> model)
        {
            string result = "";

            switch (format.FillType)
            {
            case FillType.Solid:
                result = string.Format("background-color: {0};", ColorHelper.GetRrbaColorString(format.SolidFillColor));
                break;

            case FillType.Picture:
                result = string.Format("background-image: url(\"{0}\");", ImageHelper.GetImageURL(format.PictureFillFormat.Picture.Image, model));
                break;

            case FillType.Gradient:
                result = string.Format("background: {0};", FillHelper.GetGradientFill(format.GradientFormat));
                break;

            case FillType.Pattern:
                result = string.Format("background: url(\"{0}\") repeat;", PatternGenerator.GetPatternImage(format.PatternFormat.PatternStyle, format.PatternFormat.ForeColor, format.PatternFormat.BackColor));
                break;
            }

            return(result);
        }
        public static void Run()
        {
            //ExStart:GetEffectiveValuesOfTable

            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Tables();

            using (Presentation pres = new Presentation(dataDir + "pres.pptx"))
            {
                ITable tbl = pres.Slides[0].Shapes[0] as ITable;
                ITableFormatEffectiveData  tableFormatEffective  = tbl.TableFormat.GetEffective();
                IRowFormatEffectiveData    rowFormatEffective    = tbl.Rows[0].RowFormat.GetEffective();
                IColumnFormatEffectiveData columnFormatEffective = tbl.Columns[0].ColumnFormat.GetEffective();
                ICellFormatEffectiveData   cellFormatEffective   = tbl[0, 0].CellFormat.GetEffective();

                IFillFormatEffectiveData tableFillFormatEffective  = tableFormatEffective.FillFormat;
                IFillFormatEffectiveData rowFillFormatEffective    = rowFormatEffective.FillFormat;
                IFillFormatEffectiveData columnFillFormatEffective = columnFormatEffective.FillFormat;
                IFillFormatEffectiveData cellFillFormatEffective   = cellFormatEffective.FillFormat;
            }
            //ExEnd:GetEffectiveValuesOfTable
        }