Exemplo n.º 1
0
        public void SetStrPropValue_NullValue_RemovesProperty()
        {
            var tpb = new TsPropsBldr();

            tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, "Arial");
            Assert.That(tpb.StrPropCount, Is.EqualTo(1));
            tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, null);
            Assert.That(tpb.StrPropCount, Is.EqualTo(0));
        }
Exemplo n.º 2
0
        public void SetStrPropValue_EmptyValue_InsertsProperty()
        {
            var tpb = new TsPropsBldr();

            Assert.That(tpb.StrPropCount, Is.EqualTo(0));
            tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, string.Empty);
            Assert.That(tpb.StrPropCount, Is.EqualTo(1));
            Assert.That(tpb.GetStrPropValue((int)FwTextPropType.ktptFontFamily), Is.Null);
        }
Exemplo n.º 3
0
        public void Clear_NonEmptyBldr_ClearsState()
        {
            var tpb = new TsPropsBldr();

            tpb.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, 1);
            tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, "Arial");
            Assert.That(tpb.IntPropCount, Is.EqualTo(1));
            Assert.That(tpb.StrPropCount, Is.EqualTo(1));
            tpb.Clear();
            Assert.That(tpb.IntPropCount, Is.EqualTo(0));
            Assert.That(tpb.StrPropCount, Is.EqualTo(0));
        }
Exemplo n.º 4
0
        public TsTextProps FromITsTextProps(ITsTextProps ttp)
        {
            var bldr          = new TsPropsBldr();
            int countIntProps = ttp.IntPropCount;

            for (int i = 0; i < countIntProps; i++)
            {
                int tpt, ttv;
                var val = ttp.GetIntProp(i, out tpt, out ttv);
                bldr.SetIntPropValues(tpt, ttv, val);
            }

            int countStrProps = ttp.StrPropCount;

            for (int i = 0; i < countStrProps; i++)
            {
                int tpt;
                var val = ttp.GetStrProp(i, out tpt);
                bldr.SetStrPropValue(tpt, val);
            }
            return((TsTextProps)bldr.GetTextProps());
        }