public void SetUp() { _renderer = new DefaultCodeRenderer(); ICodeFormatter formatter = new PlainTextCodeFormatter(); _empty = formatter.Format(""); _text3x7 = formatter.Format( "111\r\n" + "222\r\n" + "333\r\n" + "444\r\n" + "555\r\n" + "666\r\n" + "777\r\n"); _loremIpsum = formatter.Format( "Lorem ipsum dolor sit\r\n" + "amet, consectetur adipiscing elit.\r\n" + "Maecenas a nisi. In imperdiet, orci in\r\n" + "porta facilisis,\r\n" + "odio purus iaculis est, non varius urna turpis in mi.\r\n" + // longest line "Nullam dictum. Ut iaculis dignissim nulla.\r\n" + "Nullam condimentum porttitor leo.\r\n" + "Integer a odio et\r\n" + "velit suscipit pulvinar."); Image img = new Bitmap(100, 100); _args = new CodeRenderingContext(); _args.Graphics = Graphics.FromImage(img); _args.Font = new Font("Courier New", 12); return; }
public void SetUp() { _mockFormatter = Substitute.For<IFormatterCatalog>(); _mockRenderer = Substitute.For<ICodeRenderer>(); _box = new TestingCodeBox(_mockFormatter, _mockRenderer); _box.Width = 150; _box.Height = 150; _someText = Format("some C# code", ""); _someCode = Format("some C# code", "C#"); return; }
protected CodeBox(IFormatterCatalog formatter, ICodeRenderer renderer) { SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); DoubleBuffered = true; _formatter = formatter; _formattedCode = FormattedCode.Empty; _renderer = renderer; _currentLine = -1; _showCurrentLine = false; _language = ""; this.Font = new Font("Courier New", 8); this.BackColor = Color.White; createGraphics(); AutoScroll = true; return; }
protected CodeBox(IFormatterCatalog formatter, ICodeRenderer renderer) { SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); DoubleBuffered = true; _formatter = formatter; _formattedCode = FormattedCode.Empty; _renderer = renderer; _currentLine = -1; _showCurrentLine = false; _language = ""; this.Font = new Font(FontFamily.GenericMonospace, 8); this.BackColor = Color.White; createGraphics(); AutoScroll = true; return; }
public TestingCodeBox(IFormatterCatalog formatter, ICodeRenderer renderer) : base(formatter, renderer) { }