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); }
/// <summary> /// create VisualTextBlock or VisualSpanner from string to display on the /// canvase. If string spans multiple rows, create VisualSpanner which in turn /// contains multiple VisualTextBlock segments. /// </summary> /// <param name="ShowText"></param> /// <param name="ItemRowCol"></param> /// <param name="AttrByte"></param> /// <param name="TailAttrByte"></param> /// <returns></returns> public VisualItem VisualItemFactory(string ShowText, ZeroRowCol ItemRowCol, byte?AttrByte, byte?TailAttrByte) { VisualItem visualItem = null; if (CanvasCommon.DoesSpanMultipleRows( ItemRowCol, AttrByte, ShowText.Length) == true) { visualItem = new VisualSpanner(ShowText, ItemRowCol, AttrByte, this.CanvasDefn); } else { visualItem = new VisualTextBlock( ShowText, ItemRowCol, AttrByte, this.CanvasDefn.CharBoxDim, this.CanvasDefn.KernDim, this.CanvasDefn.FontDefn); visualItem.TailAttrByte = TailAttrByte; } return(visualItem); }
public VisualItem VisualItemFactory(ScreenContent ScreenContent, ContentField contentField) { VisualItem visualItem = null; if (contentField is ContinuedContentField) { var contField = contentField as ContinuedContentField; if (contField.ContinuedFieldSegmentCode == ContinuedFieldSegmentCode.First) { visualItem = new VisualSpanner(ScreenContent, contField, this.CanvasDefn); } } else { visualItem = this.VisualItemFactory( contentField.GetShowText(ScreenContent), contentField.RowCol, contentField.GetAttrByte(ScreenContent), contentField.GetTailAttrByte(ScreenContent)); } return(visualItem); }