Example #1
0
        public void SetIntPropValues_NegativeValue_RemovesProperty()
        {
            var tpb = new TsPropsBldr();

            tpb.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, 1);
            Assert.That(tpb.IntPropCount, Is.EqualTo(1));
            tpb.SetIntPropValues((int)FwTextPropType.ktptWs, -1, -1);
            Assert.That(tpb.IntPropCount, Is.EqualTo(0));
        }
Example #2
0
        public void SetIntPropValues_NonNegativeValue_InsertsProperty()
        {
            var tpb = new TsPropsBldr();

            Assert.That(tpb.IntPropCount, Is.EqualTo(0));
            tpb.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, 1);
            Assert.That(tpb.IntPropCount, Is.EqualTo(1));
            int var;

            Assert.That(tpb.GetIntPropValues((int)FwTextPropType.ktptWs, out var), Is.EqualTo(1));
        }
Example #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));
        }
Example #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());
        }