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

RenderAll2() private method

private RenderAll2 ( ) : void
return void
        private void RenderAll2()
        {
            try
            {
                int j = Control.View.FirstVisibleRow;


                if (Control.AutoListStartPos != null)
                {
                    try
                    {
                        if (Control.AutoListVisible)
                        {
                            Point alP = GetTextPointPixelPos(Control.AutoListStartPos);
                            if (alP == new Point(-1, -1))
                            {
                                Control.AutoList.Visible = false;
                            }
                            else
                            {
                                alP.Y += Control.View.RowHeight + 2;
                                alP.X += -20;
                                alP = Control.PointToScreen(alP);

                                Screen screen = Screen.FromPoint(new Point(Control.Right, alP.Y));

                                if (alP.Y + Control.AutoList.Height > screen.WorkingArea.Height)
                                {
                                    alP.Y -= Control.View.RowHeight + 2 + Control.AutoList.Height;
                                }

                                if (alP.X + Control.AutoList.Width > screen.WorkingArea.Width)
                                {
                                    alP.X -= alP.X + Control.AutoList.Width - screen.WorkingArea.Width;
                                }


                                Control.AutoList.Location = alP;
                                //Control.Controls[0].Focus();
                                Control.Focus();
                            }
                        }
                        
                    }
                    catch {}
                }

                if (Control.InfoTipStartPos != null)
                {
                    try
                    {
                        if (Control.InfoTipVisible)
                        {
                            Point itP = GetTextPointPixelPos(Control.InfoTipStartPos);
                            if (itP == new Point(-1, -1))
                            {
                                Control.InfoTip.Visible = false;
                            }
                            else
                            {
                                itP.Y += Control.View.RowHeight + 2;
                                itP.X += -20;

                                itP = Control.PointToScreen(itP);

                                Screen screen = Screen.FromPoint(new Point(Control.Right, itP.Y));

                                if (itP.Y + Control.InfoTip.Height > screen.WorkingArea.Height)
                                {
                                    itP.Y -= Control.View.RowHeight + 2 + Control.InfoTip.Height;
                                }

                                if (itP.X + Control.InfoTip.Width > screen.WorkingArea.Width)
                                {
                                    itP.X -= itP.X + Control.InfoTip.Width - screen.WorkingArea.Width;
                                }


                                Control.InfoTip.Location = itP;
                                Control.InfoTip.Visible = true;
                                Debug.WriteLine("Infotip Made Visible");
                            }
                        }
                        else
                        {
                            Control.InfoTip.Visible = false;
                            Debug.WriteLine("Infotip Made Invisible");
                        }
                    }
                    catch {}
                }

                for (int i = 0; i < Control.View.VisibleRowCount; i++)
                {
                    if (j >= 0 && j < Control.Document.VisibleRows.Count)
                    {
                        Row r = Control.Document.VisibleRows[j];
                        if (RenderCaretRowOnly)
                        {
                            if (r == Control.Caret.CurrentRow)
                            {
                                RenderRow(Control.Document.IndexOf(r), i);
                            }
                            //Control.Caret.CurrentRow.expansion_EndSpan.StartRow.Index
                            if (Control.Caret.CurrentRow.expansion_EndSpan != null && Control.Caret.CurrentRow.expansion_EndSpan.StartRow != null && Control.Caret.CurrentRow.expansion_EndSpan.StartRow == r)
                            {
                                RenderRow(Control.Document.IndexOf(r), i);
                            }
                        }
                        else
                        {
                            RenderRow(Control.Document.IndexOf(r), i);
                        }
                    }
                    else
                    {
                        if (RenderCaretRowOnly) {}
                        else
                        {
                            RenderRow(Control.Document.Count, i);
                        }
                    }
                    j++;
                }
            }
            catch
            {
            }
        }