Exemple #1
0
 public void WhenPaintingBackground(EditorPaintEventArgs ea)
 {
     if (showingOverlay)
     {
         overlay.Update(service.GetCoverageResultsForActiveDocument());
     }
 }
 void events_EditorPaint(EditorPaintEventArgs ea)
 {
     if (shutting_down)
     {
         return;
     }
     HighlightSelectedText(ea.Graphics);
 }
 /// <summary>
 /// Draw all the test attributes the same and put the status color in the background
 /// </summary>
 private void RedrawTestAttribute(EditorPaintEventArgs paintArgs, UnitTestDetail testData)
 {
     if (paintArgs.LineInView(testData.Attribute.StartLine) && testData.Result.Status != TestStatus.Unknown)
     {
         Point     topLeft    = paintArgs.TextView.GetPoint(testData.Attribute.StartLine, testData.Attribute.Parent.StartOffset);
         Point     lowerRight = paintArgs.TextView.GetPoint(testData.Attribute.StartLine + 1, paintArgs.TextView.LengthOfLine(testData.Method.StartLine) + 1);
         Rectangle area       = new Rectangle(topLeft.X, topLeft.Y, lowerRight.X - topLeft.X, lowerRight.Y - topLeft.Y);
         using (Brush b = new SolidBrush(GetBackgroundColor(testData.Result.Status)))
         {
             paintArgs.Graphics.FillRectangle(b, area);
         }
     }
 }
        /// <summary>
        /// Draw the icon for the tile
        /// </summary>
        /// <param name="attributes"></param>
        private void DrawTestRunnerIcon(EditorPaintEventArgs paintArgs, ITestDetail attributes)
        {
            Rectangle indicator = CreateIndicator(paintArgs, attributes.IconCoordinates);

            paintArgs.TextView.AddTile(NewTile(indicator, attributes));
            try
            {
                paintArgs.TextView.Graphics.DrawIcon(new Icon(GetType(), "TestIndicator.ico"), indicator);
            }
            catch
            {// fail silently if icon is missing from the project.
            }
        }
 private void Colorizer_Plugin_EditorPaint(EditorPaintEventArgs ea)
 {
     if (_paintableElements.Count == 0)
     {
         BuildElementCache();
     }
     foreach (var colorInfo in _paintableElements)
     {
         if (ea.TextView.Lines.IsVisible(colorInfo.Element.NameRange.Start.Line))
         {
             ea.OverlayText(colorInfo.Element.Name, colorInfo.Element.NameRange.Start, colorInfo.Color);
         }
     }
 }
        private Rectangle CreateIndicator(EditorPaintEventArgs paintArgs, SourcePoint referencePoint)
        {
            Point     topLeft   = paintArgs.TextView.GetPoint(referencePoint.Line, referencePoint.Offset);
            Rectangle indicator = new Rectangle(topLeft.X - 24, topLeft.Y + 2, 16, 16);

            Tile tile = ((TextView)CodeRush.Source.Active.View).ActiveTile;

            if (TileIsOurs(tile))
            {// cursor is over tile give a hint
                paintArgs.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
                using (SolidBrush backgroundFill = new SolidBrush(TileBackgroundFillColor))
                {
                    paintArgs.Graphics.FillRectangle(backgroundFill, indicator);
                }
                using (Pen borderHighlight = new Pen(TileBorderColor))
                {
                    paintArgs.Graphics.DrawRectangle(borderHighlight, indicator.X, indicator.Y, indicator.Width - 1, indicator.Width - 1);
                }
            }
            return(indicator);
        }
 private void BlockPainterPlugIn_EditorPaintBackground(EditorPaintEventArgs ea)
 {
     _processedLines.Clear();
 }
 private void BlockPainterPlugIn_EditorPaintBackground(EditorPaintEventArgs ea)
 {
     _processedLines.Clear();
 }
 void events_EditorPaint(EditorPaintEventArgs ea)
 {
     if (shutting_down) return;
     HighlightSelectedText(ea.Graphics);
 }
		public void WhenPaintingBackground(EditorPaintEventArgs ea)
		{
            if (showingOverlay)
			    overlay.Update(service.GetCoverageResultsForActiveDocument());
		}
 private void PlugIn1_EditorPaint(EditorPaintEventArgs ea)
 {
     _background = ea.BackgroundBrush;
     _editorGraphics = ea.Graphics;
 }
        /// <summary>
        /// Draw all the test attributes the same and put the status color in the background
        /// </summary>
        private void RedrawTestAttribute(EditorPaintEventArgs paintArgs, UnitTestDetail testData)
        {
			if (paintArgs.LineInView(testData.Attribute.StartLine) && testData.Result.Status != TestStatus.Unknown)
			{
				Point topLeft = paintArgs.TextView.GetPoint(testData.Attribute.StartLine, testData.Attribute.Parent.StartOffset);
				Point lowerRight = paintArgs.TextView.GetPoint(testData.Attribute.StartLine + 1, paintArgs.TextView.LengthOfLine(testData.Method.StartLine) + 1);
				Rectangle area = new Rectangle(topLeft.X, topLeft.Y, lowerRight.X - topLeft.X, lowerRight.Y - topLeft.Y);
				using (Brush b = new SolidBrush(GetBackgroundColor(testData.Result.Status)))
				{
					paintArgs.Graphics.FillRectangle(b, area);
				}
			}
        }
        private Rectangle CreateIndicator(EditorPaintEventArgs paintArgs, SourcePoint referencePoint)
        {
            Point topLeft = paintArgs.TextView.GetPoint(referencePoint.Line, referencePoint.Offset);
            Rectangle indicator = new Rectangle(topLeft.X - 24, topLeft.Y + 2, 16, 16);

            Tile tile = ((TextView)CodeRush.Source.Active.View).ActiveTile;
            if (TileIsOurs(tile))
            {// cursor is over tile give a hint
                paintArgs.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
                using (SolidBrush backgroundFill = new SolidBrush(TileBackgroundFillColor))
                {
                    paintArgs.Graphics.FillRectangle(backgroundFill, indicator);
                }
                using (Pen borderHighlight = new Pen(TileBorderColor))
                {
                    paintArgs.Graphics.DrawRectangle(borderHighlight, indicator.X, indicator.Y, indicator.Width - 1, indicator.Width - 1);
                }
            }
            return indicator;
        }
 /// <summary>
 /// Draw the icon for the tile
 /// </summary>
 /// <param name="attributes"></param>
 private void DrawTestRunnerIcon(EditorPaintEventArgs paintArgs, ITestDetail attributes)
 {
     Rectangle indicator = CreateIndicator(paintArgs, attributes.IconCoordinates);
     paintArgs.TextView.AddTile(NewTile(indicator, attributes));
     try
     {
         paintArgs.TextView.Graphics.DrawIcon(new Icon(GetType(), "TestIndicator.ico"), indicator);
     }
     catch
     {// fail silently if icon is missing from the project.
     }
 }
 private void PlugIn1_EditorPaint(EditorPaintEventArgs ea)
 {
     _background     = ea.BackgroundBrush;
     _editorGraphics = ea.Graphics;
 }