コード例 #1
0
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Length distance =
                pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetLength();
            Length separation =
                pInfo.getPropertyList().GetNearestSpecifiedProperty("provisional-label-separation").GetLength();

            FObj item = pInfo.getFO();

            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("label-end() called from outside an fo:list-item");
            }
            Length startIndent = item.properties.GetProperty("start-indent").GetLength();

            LinearCombinationLength labelEnd = new LinearCombinationLength();

            LengthBase bse = new LengthBase(item, pInfo.getPropertyList(),
                                            LengthBase.CONTAINING_BOX);
            PercentLength refWidth = new PercentLength(1.0, bse);

            labelEnd.AddTerm(1.0, refWidth);
            labelEnd.AddTerm(-1.0, distance);
            labelEnd.AddTerm(-1.0, startIndent);
            labelEnd.AddTerm(1.0, separation);

            labelEnd.ComputeValue();

            return(new LengthProperty(labelEnd));
        }
コード例 #2
0
ファイル: LabelEndFunction.cs プロジェクト: nholik/Fo.Net
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Length distance =
                pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetLength();
            Length separation =
                pInfo.getPropertyList().GetNearestSpecifiedProperty("provisional-label-separation").GetLength();

            FObj item = pInfo.getFO();
            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("label-end() called from outside an fo:list-item");
            }
            Length startIndent = item.properties.GetProperty("start-indent").GetLength();

            LinearCombinationLength labelEnd = new LinearCombinationLength();

            LengthBase bse = new LengthBase(item, pInfo.getPropertyList(),
                                            LengthBase.CONTAINING_BOX);
            PercentLength refWidth = new PercentLength(1.0, bse);

            labelEnd.AddTerm(1.0, refWidth);
            labelEnd.AddTerm(-1.0, distance);
            labelEnd.AddTerm(-1.0, startIndent);
            labelEnd.AddTerm(1.0, separation);

            labelEnd.ComputeValue();

            return new LengthProperty(labelEnd);
        }
コード例 #3
0
ファイル: BodyStartFunction.cs プロジェクト: nholik/Fo.Net
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Numeric distance = pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetNumeric();

            FObj item = pInfo.getFO();
            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("body-start() called from outside an fo:list-item");
            }

            Numeric startIndent =
                item.properties.GetProperty("start-indent").GetNumeric();

            return new NumericProperty(distance.add(startIndent));
        }
コード例 #4
0
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Numeric distance = pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetNumeric();

            FObj item = pInfo.getFO();

            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("body-start() called from outside an fo:list-item");
            }

            Numeric startIndent =
                item.properties.GetProperty("start-indent").GetNumeric();

            return(new NumericProperty(distance.add(startIndent)));
        }