/// <summary> /// Intended for use only by AssembledStylesCache to make derived styles. /// If inheritedOnly is true, only those properties are copied which should be inherited by /// nested boxes. /// </summary> internal AssembledStyles(AssembledStyles basedOn, bool inheritedOnly) { m_styleCache = basedOn.m_styleCache; // all derived styles share it m_chrp = basedOn.m_chrp; m_lineHeight = basedOn.m_lineHeight; m_firstLineIndent = basedOn.m_firstLineIndent; m_styleName = basedOn.m_styleName; RightToLeft = basedOn.RightToLeft; if (inheritedOnly) { SetNonInheritedDefaults(); } else { // copy everything else, too. m_paraAlignment = basedOn.m_paraAlignment; m_borderColor = basedOn.m_borderColor; m_borders = basedOn.m_borders; m_margins = basedOn.m_margins; m_pads = basedOn.m_pads; m_weight = basedOn.m_weight; } }
/// <summary> /// Default constructor sets initial state /// </summary> public AssembledStyles(IStylesheet stylesheet) { m_styleCache = new AssembledStylesCache(stylesheet); FontWeight = (int)VwFontWeight.kvfwNormal; m_chrp.dympHeight = 10000; // default 10 pt SetFaceName(DefaultFontName); m_chrp.clrFore = ColorUtil.ConvertColorToBGR(Color.Black); m_chrp.clrUnder = m_chrp.clrFore; m_borderColor = Color.Black; m_chrp.clrBack = ColorUtil.ConvertColorToBGR(Color.Transparent); SetNonInheritedDefaults(); m_styleCache.m_canonicalStyles[this] = this; // AFTER setting all props!! }