public void TextLine() { var content = PrintContent.TextLine("Test"); content.FontSize = 32; content.Background = Brushes.Bisque; content.FontWeight = FontWeights.ExtraBold; content.HorizontalAlignment = HorizontalAlignment.Right; content.Padding = new Thickness(12); content.Margin = new Thickness(24); Assert.That(content.Text, Is.EqualTo("Test")); var icontent = (IPrintContent)content; var grid = (Grid)icontent.Content; var uiElement = (TextBlock)grid.Children[0]; Assert.That(uiElement.Text, Is.EqualTo("Test")); Assert.That(uiElement.FontSize, Is.EqualTo(32)); Assert.That(grid.Background, Is.EqualTo(Brushes.Bisque)); Assert.That(uiElement.FontWeight, Is.EqualTo(FontWeights.ExtraBold)); Assert.That(uiElement.HorizontalAlignment, Is.EqualTo(HorizontalAlignment.Right)); Assert.That(uiElement.Padding, Is.EqualTo(new Thickness(12))); Assert.That(grid.Margin, Is.EqualTo(new Thickness(24))); }
public override IEnumerable <IPrintContent> ItemCollection() { yield return(PrintContent.TextLine("Test", 10)); yield return(PrintContent.BlankLine(50)); yield return(PrintContent.PageBreak()); yield return(PrintContent.BlankLine(50)); yield return(PrintContent.BlankLine(90)); yield return(new DirectPrintContent { Content = new TextBlock { Background = Brushes.Red } }); yield return(PrintContent.BlankLine(100)); }
public void TextLine_Configuration() { StringLineItemConfiguration configuration = new StringLineItemConfiguration() { FontFamily = new FontFamily("Verdana"), FontSize = 10, HorizontalAlignment = HorizontalAlignment.Right }; var content = PrintContent.TextLine("Test", configuration); var icontent = (IPrintContent)content; var grid = (Grid)icontent.Content; var uiElement = (TextBlock)grid.Children[0]; Assert.That(uiElement.FontSize, Is.EqualTo(10)); Assert.That(uiElement.FontFamily, Is.EqualTo(new FontFamily("Verdana"))); Assert.That(uiElement.HorizontalAlignment, Is.EqualTo(HorizontalAlignment.Right)); }
public override IEnumerable <IPrintContent> ItemCollection() { return(_collToPrint.Select(obj => PrintContent.TextLine(obj.Text))); //return _collToPrint.Select(obj => new MyShownObjectLineItem(obj, _printDimensions)); }
public override IEnumerable <IPrintContent> ItemCollection() { return(_collToPrint.Select(obj => PrintContent.TextLine(obj.Text))); }
public override IEnumerable <IPrintContent> ItemCollection() { yield return(PrintContent.TextLine("Test", 10)); }
public override IEnumerable <IPrintContent> ItemCollection() { return(_collToPrint.Where(e => e.Text != null) .Select(e => e.Text !) .Select(text => PrintContent.TextLine(text))); }
public void TextLine_Configuration_Null_Throws() { Assert.That(() => PrintContent.TextLine("Test", null), Throws.ArgumentNullException); }