XPTable.Models.Table.OnPaintEmptyTableText C# (CSharp) Method

OnPaintEmptyTableText() protected method

Paints the message that is displayed when the Table doen't contain any items
protected OnPaintEmptyTableText ( PaintEventArgs e ) : void
e PaintEventArgs A PaintEventArgs that contains the event data
return void
        protected void OnPaintEmptyTableText(PaintEventArgs e)
        {
            if (this.ColumnModel == null || this.RowCount == 0)
            {
                Rectangle client = this.CellDataRect;

                client.Y += 10;
                client.Height -= 10;

                StringFormat format = new StringFormat();
                format.Alignment = StringAlignment.Center;

                using (SolidBrush brush = new SolidBrush(this.ForeColor))
                {
                    if (this.DesignMode)
                    {
                        if (this.ColumnModel == null || this.TableModel == null)
                        {
                            string text = null;

                            if (this.ColumnModel == null)
                            {
                                if (this.TableModel == null)
                                {
                                    text = "Table does not have a ColumnModel or TableModel";
                                }
                                else
                                {
                                    text = "Table does not have a ColumnModel";
                                }
                            }
                            else if (this.TableModel == null)
                            {
                                text = "Table does not have a TableModel";
                            }

                            e.Graphics.DrawString(text, this.Font, brush, client, format);
                        }
                        else if (this.TableModel != null && this.TableModel.Rows.Count == 0)
                        {
                            if (this.NoItemsText != null && this.NoItemsText.Length > 0)
                            {
                                e.Graphics.DrawString(this.NoItemsText, this.Font, brush, client, format);
                            }
                        }
                    }
                    else
                    {
                        if (this.NoItemsText != null && this.NoItemsText.Length > 0)
                        {
                            e.Graphics.DrawString(this.NoItemsText, this.Font, brush, client, format);
                        }
                    }
                }
            }
        }
Table