public override void DrawTableCell(LayoutTableCell tableCell)
        {
            if (MainWindow.customDrawTable == true)
            {
                Rectangle Tbounds = tableCell.Bounds;

                int       x = Tbounds.X + Tbounds.Width / 2 - Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel);
                int       y = Tbounds.Y + Tbounds.Height / 2 - Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel);
                Rectangle tableRectangle = new Rectangle(x, y, Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel),
                                                         Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel));

                Canvas.FillEllipse(new RichEditBrush(System.Windows.Media.Color.FromRgb(102, 205, 170)), tableRectangle);
                base.DrawTableCell(tableCell);
            }
            else
            {
                base.DrawTableCell(tableCell);
            }
        }
        public override void DrawTableCell(LayoutTableCell tableCell)
        {
            if (Form1.customDrawTable == true)
            {
                Rectangle Tbounds = tableCell.Bounds;

                int       x = Tbounds.X + Tbounds.Width / 2 - Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel);
                int       y = Tbounds.Y + Tbounds.Height / 2 - Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel);
                Rectangle tableRectangle = new Rectangle(x, y, Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel),
                                                         Canvas.ConvertToDrawingLayoutUnits(20, DocumentLayoutUnit.Pixel));

                Canvas.FillEllipse(new RichEditBrush(Color.MediumAquamarine), tableRectangle);
                base.DrawTableCell(tableCell);
            }
            else
            {
                base.DrawTableCell(tableCell);
            }
        }
 protected override void VisitTableCell(LayoutTableCell tableCell)
 {
     TryAddElementToCollection(tableCell, ContentDisplayAction.Select, true);
     base.VisitTableCell(tableCell);
 }
 public override void DrawTableCell(LayoutTableCell tableCell)
 {
     base.DrawTableCell(tableCell);
     HighlightElement(tableCell);
 }
 protected override void VisitTableCell(LayoutTableCell tableCell)
 {
     AddTreeNode(tableCell, ContentDisplayAction.Select);
     base.VisitTableCell(tableCell);
 }
        // get information about a current table cell
        public static string GetInformationAboutCurrentTableCell(Document currentDocument, LayoutTableCell tableCell)
        {
            string returnedInformation = "!A TABLE CELL IS SELECTED!\r\n";
            string cellText            = currentDocument.GetText(currentDocument.CreateRange(tableCell.Range.Start, tableCell.Range.Length - 1));

            returnedInformation += String.Format("Cell's content: {0}\r\n", cellText);

            LayoutTableRow currentRow = tableCell.Parent as LayoutTableRow;

            if (currentRow == null)
            {
                return(returnedInformation);
            }
            LayoutTable currentTable = currentRow.Parent as LayoutTable;

            if (currentTable == null)
            {
                return(returnedInformation);
            }

            returnedInformation += String.Format("Row index: {0}\r\n", currentTable.TableRows.ToList().IndexOf(currentRow) + 1);
            for (int i = 0; i < currentRow.TableCells.Count; i++)
            {
                if (currentRow.TableCells[i] == tableCell)
                {
                    returnedInformation += String.Format("Column index: {0}\r\n", i + 1);
                    break;
                }
            }

            returnedInformation += String.Format("\r\n!Table information:\r\n");
            returnedInformation += String.Format("Row count: {0}\r\n", currentTable.TableRows.Count);
            int maxCellsCount = 0;

            for (int i = 0; i < currentTable.TableRows.Count; i++)
            {
                if (currentTable.TableRows[i].TableCells.Count > maxCellsCount)
                {
                    maxCellsCount = currentTable.TableRows[i].TableCells.Count;
                }
            }
            returnedInformation += String.Format("Column count: {0}\r\n", maxCellsCount);
            return(returnedInformation);
        }