Ejemplo n.º 1
0
        public void DrawToGraphics_Can_Raise_ArgumentNullException()
        {
            try {
                _renderer.DrawToGraphics(null, _args, new Rectangle()); // throws exception
                Assert.Fail();
            }
            catch (Exception e) {
                Assert.True(e.Message.Contains("code"));
            }

            try {
                _renderer.DrawToGraphics(_loremIpsum, null, new Rectangle()); // throws exception
                Assert.Fail();
            }
            catch (Exception e) {
                Assert.True(e.Message.Contains("g"));
            }

            return;
        }
Ejemplo n.º 2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics backup;

            base.OnPaint(e);

            backup = _workingContext.Graphics;
            _workingContext.Graphics    = e.Graphics;
            _workingContext.CurrentLine = (_showCurrentLine ? _currentLine : -1);

            _renderer.DrawToGraphics(_formattedCode, _workingContext,
                                     new Rectangle(-AutoScrollPosition.X, -AutoScrollPosition.Y, Width, Height));

            _workingContext.Graphics = backup;

            return;
        }