public void GetCssData_Test() { var table1 = Doc2web.Tests.Samples.TableSimple.Build3x3(); var grid1 = _instance.AddTable(table1, 0); var table2 = Doc2web.Tests.Samples.TableSimple.Build3x3(); var grid2 = _instance.AddTable(table2, 0); var expected = new CssData(); expected.AddRange(grid1.AsCssData()); expected.AddRange(grid2.AsCssData()); var result = _instance.GetCssData(); Assert.AreEqual(expected, result); }
public CssData GetCssData() { var cssData = new CssData(); foreach (var grid in _grids) { cssData.AddRange(grid.AsCssData()); } return(cssData); }
public void PostProcessing(IProcessingState state) { var cssData = new CssData(); foreach (var elemState in state.Elements) { if (elemState.GetContext(out TableContext tc)) { cssData.AddRange(tc.GetCssData()); } } state.Css.Append(CSS); cssData.RenderInto(state.Css); }
private IElementProcessingState MockElemProcessingStateWithTableContext() { var tableContext = new TableContext() { GridStateFactory = _instance.GridStateFactory }; tableContext.AddTable(TableSimple.Build3x3(), 0); _fullCssData.AddRange(tableContext.GetCssData()); var elemState = new ElementProcessingState(); elemState.SetContext(tableContext); return(elemState); }
public void AddRange_Test() { var expected = new CssData(); expected.AddAttribute("span", "color", "red"); expected.AddAttribute("span", "font", "bold"); expected.AddAttribute("p", "margin-top", "20px"); var cssData1 = new CssData(); cssData1.AddAttribute("span", "color", "blue"); cssData1.AddAttribute("span", "font", "bold"); var cssData2 = new CssData(); cssData2.AddAttribute("span", "color", "red"); cssData2.AddAttribute("p", "margin-top", "20px"); cssData1.AddRange(cssData2); Assert.AreEqual(expected, cssData1); }
public void InsertCss(CssPropertiesSet other, CssData cssData) { cssData.AddRange(_cssData); }