public void TestGetStyleRgch() { IVwStylesheet stylesheet = (IVwStylesheet) new TestFwStylesheet(); ITsPropsBldr propsBldr = TsPropsBldrClass.Create(); propsBldr.SetStrPropValue((int)FwTextStringProp.kstpFontFamily, "Times"); ITsTextProps props1 = propsBldr.GetTextProps(); propsBldr.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, 256); ITsTextProps props2 = propsBldr.GetTextProps(); int hvoNewStyle1 = stylesheet.MakeNewStyle(); stylesheet.PutStyle("FirstStyle", "bla", hvoNewStyle1, 0, hvoNewStyle1, 0, false, false, props1); int hvoNewStyle2 = stylesheet.MakeNewStyle(); stylesheet.PutStyle("SecondStyle", "bla", hvoNewStyle2, 0, hvoNewStyle1, 0, false, false, props2); string sHowDifferent; bool fEqual = TsTextPropsHelper.PropsAreEqual(props2, stylesheet.GetStyleRgch(0, "SecondStyle"), out sHowDifferent); Assert.IsTrue(fEqual, sHowDifferent); fEqual = TsTextPropsHelper.PropsAreEqual(props1, stylesheet.GetStyleRgch(0, "FirstStyle"), out sHowDifferent); Assert.IsTrue(fEqual, sHowDifferent); }
public void TestGetNextStyle() { IVwStylesheet stylesheet = (IVwStylesheet) new TestFwStylesheet(); int hvoNewStyle1 = stylesheet.MakeNewStyle(); stylesheet.PutStyle("FirstStyle", "bla", hvoNewStyle1, 0, 0, 0, false, false, null); int hvoNewStyle2 = stylesheet.MakeNewStyle(); stylesheet.PutStyle("SecondStyle", "bla", hvoNewStyle2, 0, hvoNewStyle1, 0, false, false, null); Assert.AreEqual("FirstStyle", stylesheet.GetNextStyle("SecondStyle")); }
public void TestAddAndRetrieveStyle() { IVwStylesheet stylesheet = (IVwStylesheet) new TestFwStylesheet(); int hvoNewStyle = stylesheet.MakeNewStyle(); stylesheet.PutStyle("FirstStyle", "bls", hvoNewStyle, 0, hvoNewStyle, 0, false, false, null); Assert.AreEqual(hvoNewStyle, stylesheet.get_NthStyle(0)); }