Example #1
0
        private VisualItem VisualItemFactory(IVisualItem ShowItem)
        {
            VisualItem visualItem = null;

            if (ShowItem.DoesShowSpanMultipleRows() == true)
            {
                visualItem = new VisualSpanner(
                    ShowItem.ShowText, ShowItem.ItemRowCol, ShowItem.AttrByte,
                    this.CanvasDefn);
                visualItem.CreateFromItem = (ShowItemBase)ShowItem;
            }
            else
            {
                visualItem = new VisualTextBlock(
                    ShowItem.ShowText, ShowItem.ItemRowCol, ShowItem.AttrByte,
                    this.CanvasDefn.CharBoxDim, this.CanvasDefn.KernDim,
                    this.CanvasDefn.FontDefn);
                visualItem.CreateFromItem = (ShowItemBase)ShowItem;
            }
            return(visualItem);
        }