Alsing.Windows.Forms.SyntaxBox.Painter.NativePainter.RenderExpansion C# (CSharp) Method

RenderExpansion() private method

private RenderExpansion ( int RowIndex ) : void
RowIndex int
return void
        private void RenderExpansion(int RowIndex)
        {
            if (Control == null)
                throw new NullReferenceException("Control may not be null");

            if (RowIndex <= Control.Document.Count - 1)
            {
                const int yo = 4;
                Row xtr = Control.Document[RowIndex];
                GDISurface bbuff = GFX.BackBuffer;
                if (xtr.endSpan != null)
                {
                    if (xtr.expansion_StartSpan != null && xtr.startSpan.Parent == null)
                    {
                        if (!xtr.IsCollapsed)
                        {
                            bbuff.FillRect(GFX.OutlineBrush, Control.View.TotalMarginWidth + 6, yo, 1, Control.View.RowHeight - yo);
                        }
                    }
                    else if ((xtr.endSpan.Parent != null || xtr.expansion_EndSpan != null))
                    {
                        bbuff.FillRect(GFX.OutlineBrush, Control.View.TotalMarginWidth + 6, 0, 1, Control.View.RowHeight);
                    }

                    if (xtr.expansion_StartSpan != null)
                    {
                        bbuff.FillRect(GFX.OutlineBrush, Control.View.TotalMarginWidth + 2, yo, 9, 9);
                        bbuff.FillRect(GFX.BackgroundBrush, Control.View.TotalMarginWidth + 3, yo + 1, 7, 7);
                        //render plus / minus
                        bbuff.FillRect(GFX.OutlineBrush, Control.View.TotalMarginWidth + 4, yo + 4, 5, 1);
                        if (!xtr.expansion_StartSpan.Expanded)
                            bbuff.FillRect(GFX.OutlineBrush, Control.View.TotalMarginWidth + 6, yo + 2, 1, 5);
                    }
                    if (xtr.expansion_EndSpan != null)
                    {
                        bbuff.FillRect(GFX.OutlineBrush, Control.View.TotalMarginWidth + 7, Control.View.RowHeight - 1, 5, 1);
                    }
                }

                //				//RENDER SPAN LINES
                //				if (SpanFound)
                //				{
                //					if (RowIndex==FirstSpanRow)
                //						bbuff.FillRect (GFX.OutlineBrush,this.Control.View.TotalMarginWidth +14,0,Control.ClientWidth ,1);
                //
                //					if (RowIndex==LastSpanRow)
                //						bbuff.FillRect (GFX.OutlineBrush,this.Control.View.TotalMarginWidth +14,Control.View.RowHeight-1,Control.ClientWidth,1);				
                //				}

                //RENDER SPAN MARGIN
                if (SpanFound && Control._SyntaxBox.ScopeIndicatorColor != Color.Transparent && Control._SyntaxBox.ShowScopeIndicator)
                {
                    if (RowIndex >= FirstSpanRow && RowIndex <= LastSpanRow)
                        bbuff.FillRect(Control._SyntaxBox.ScopeIndicatorColor, Control.View.TotalMarginWidth + 14, 0, 2, Control.View.RowHeight);

                    if (RowIndex == FirstSpanRow)
                        bbuff.FillRect(Control._SyntaxBox.ScopeIndicatorColor, Control.View.TotalMarginWidth + 14, 0, 4, 2);

                    if (RowIndex == LastSpanRow)
                        bbuff.FillRect(Control._SyntaxBox.ScopeIndicatorColor, Control.View.TotalMarginWidth + 14, Control.View.RowHeight - 2, 4, 2);
                }
            }
        }