예제 #1
0
파일: XWPFRun.cs 프로젝트: Yvees/npoi
        public void SetStrike(bool value)
        {
            CT_RPr   pr     = run.IsSetRPr() ? run.rPr : run.AddNewRPr();
            CT_OnOff strike = pr.IsSetStrike() ? pr.strike : pr.AddNewStrike();

            strike.val = value;
        }
예제 #2
0
        /**
         * Specifies that the contents of this run.shall be displayed with a single
         * horizontal line through the center of the line.
         * <p/>
         * This formatting property is a toggle property, which specifies that its
         * behavior differs between its use within a style defInition and its use as
         * direct formatting. When used as part of a style defInition, Setting this
         * property shall toggle the current state of that property as specified up
         * to this point in the hierarchy (i.e. applied to not applied, and vice
         * versa). Setting it to false (or an equivalent) shall result in the
         * current Setting remaining unChanged. However, when used as direct
         * formatting, Setting this property to true or false shall Set the absolute
         * state of the resulting property.
         * </p>
         * <p/>
         * If this element is not present, the default value is to leave the
         * formatting applied at previous level in the style hierarchy. If this
         * element is never applied in the style hierarchy, then strikethrough shall
         * not be applied to the contents of this run.
         * </p>
         *
         * @param value <code>true</code> if the strike property is applied to
         *              this run
         */
        public void SetStrike(bool value)
        {
            CT_RPr   pr     = run.IsSetRPr() ? run.rPr : run.AddNewRPr();
            CT_OnOff strike = pr.IsSetStrike() ? pr.strike : pr.AddNewStrike();

            strike.val = (value ? ST_OnOff.True : ST_OnOff.False);
        }
예제 #3
0
        public void TestSetGetStrike()
        {
            CT_RPr rpr = ctRun.AddNewRPr();

            rpr.AddNewStrike().val = (ST_OnOff.True);

            XWPFRun run = new XWPFRun(ctRun, p);

            Assert.AreEqual(true, run.IsStrike());

            run.SetStrike(false);
            Assert.AreEqual(ST_OnOff.False, rpr.strike.val);
        }
예제 #4
0
        public void SetStrike(bool value)
        {
            CT_RPr ctRpr = this.run.IsSetRPr() ? this.run.rPr : this.run.AddNewRPr();

            (ctRpr.IsSetStrike() ? ctRpr.strike : ctRpr.AddNewStrike()).val = value ? ST_OnOff.True : ST_OnOff.False;
        }