/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="StTxtParaBldr"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public StTxtParaBldr(FdoCache cache) { System.Diagnostics.Debug.Assert(cache != null); m_cache = cache; ITsStrFactory tsStringFactory = TsStrFactoryClass.Create(); m_ParaStrBldr = tsStringFactory.GetBldr(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="StTxtParaBldr"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public StTxtParaBldr(FdoCache cache) { System.Diagnostics.Debug.Assert(cache != null); m_cache = cache; ITsStrFactory tsStringFactory = cache.TsStrFactory; m_ParaStrBldr = tsStringFactory.GetBldr(); // Give the builder a default WS so a created string will be legal. If any text // is added to the builder, it should replace this WS with the correct WS. m_ParaStrBldr.Replace(0, 0, null, StyleUtils.CharStyleTextProps(null, cache.DefaultVernWs)); }
/// <summary> /// Make a TsString in the specified (typicaly UI) writing system, which is forced to be /// displayed in the default UIElement style. /// </summary> protected ITsString MakeUiElementString(string text, int uiWs, Action <ITsPropsBldr> SetAdditionalProps) { ITsStrBldr bldr = m_tsf.GetBldr(); ITsPropsBldr propsBldr = TsPropsBldrClass.Create(); propsBldr.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, uiWs); propsBldr.SetStrPropValue((int)FwTextPropType.ktptNamedStyle, StyleServices.UiElementStylename); if (SetAdditionalProps != null) { SetAdditionalProps(propsBldr); } bldr.Replace(0, 0, text, propsBldr.GetTextProps()); return(bldr.GetString()); }