private void SetPageUpButtonStatus()
        {
            bool     enabled      = false;
            HeapCell selectedCell = Cell;

            if (selectedCell != null)
            {
                SymbianUtils.RawItems.RawItemCollection rawItems = selectedCell.RawItems;
                //
                int previousWindowStart = DisplayRawDataItemIndex - KNumberOfRowsPerPage;
                int previousWindowEnd   = DisplayRawDataItemIndex;
                //
                enabled = (previousWindowStart >= 0);
            }
            iButton_PageUp.Enabled = enabled;
        }
        private void SetPageDownButtonStatus()
        {
            bool     enabled      = false;
            HeapCell selectedCell = Cell;

            if (selectedCell != null)
            {
                SymbianUtils.RawItems.RawItemCollection rawItems = selectedCell.RawItems;
                //
                int nextWindowStart = DisplayRawDataItemIndex + KNumberOfRowsPerPage;
                int nextWindowEnd   = Math.Min(rawItems.Count, nextWindowStart + KNumberOfRowsPerPage);
                //
                enabled = (nextWindowStart < rawItems.Count);
            }
            iButton_PageDown.Enabled = enabled;
        }
        private void UpdateTable()
        {
            HeapCell cell = Cell;

            //
            iTable_RawItems.BeginUpdate();
            iTableModel.Rows.Clear();
            //
            if (cell != null)
            {
                // Work out our raw item offset and how many raw items to create in this operation
                SymbianUtils.RawItems.RawItemCollection rawItems = cell.RawItems;
                int rawItemIndexStart = DisplayRawDataItemIndex;
                int rawItemIndexEnd   = Math.Min(rawItems.Count, rawItemIndexStart + KNumberOfRowsPerPage);
                //
                for (int rawItemIndex = rawItemIndexStart; rawItemIndex < rawItemIndexEnd; rawItemIndex++)
                {
                    SymbianUtils.RawItems.RawItem rawEntry = rawItems[rawItemIndex];
                    XPTable.Models.Row            row      = new XPTable.Models.Row();

                    // Cell 1: address
                    XPTable.Models.Cell cellAddress = new XPTable.Models.Cell(rawEntry.Address.ToString("x8"));

                    // Cell 2: raw data
                    XPTable.Models.Cell cellRawData = new XPTable.Models.Cell(rawEntry.OriginalData.ToString("x8"));

                    // Cell 3: interpreted data
                    XPTable.Models.Cell cellInterpretedData = new XPTable.Models.Cell(rawEntry.Data.ToString("x8"));

                    // Cell 4: characterised data
                    XPTable.Models.Cell cellCharacterisedData = new XPTable.Models.Cell(rawEntry.OriginalCharacterisedData);

                    // Update style of "interpreted data" if there is a link to another cell.
                    RelationshipInfo relationshipDescriptor = (rawEntry.Tag != null && rawEntry.Tag is RelationshipInfo) ? (RelationshipInfo)rawEntry.Tag : null;
                    if (relationshipDescriptor != null)
                    {
                        // The colour depends on whether it is a clean link or not. Clean means whether or not the
                        // link points to the start of the specified cell.
                        HeapCell linkedCell = relationshipDescriptor.ToCell;
                        //
                        if (relationshipDescriptor.IsCleanLink)
                        {
                            cellInterpretedData.ForeColor   = Color.Blue;
                            cellInterpretedData.ToolTipText = "Link to start of: " + linkedCell.SymbolString + " @ 0x" + linkedCell.Address.ToString("x8");
                        }
                        else
                        {
                            cellInterpretedData.ForeColor   = Color.DarkBlue;
                            cellInterpretedData.ToolTipText = "Link within: " + linkedCell.SymbolString + " @ 0x" + linkedCell.Address.ToString("x8");
                        }

                        cellInterpretedData.Font = new Font(iTable_RawItems.Font, FontStyle.Underline);
                        cellInterpretedData.Tag  = linkedCell;
                    }

                    // Finish construction
                    row.Cells.Add(cellAddress);
                    row.Cells.Add(cellRawData);
                    row.Cells.Add(cellInterpretedData);
                    row.Cells.Add(cellCharacterisedData);
                    iTableModel.Rows.Add(row);
                }
            }

            // Try to select first item
            if (iTable_RawItems.TableModel.Rows.Count > 0)
            {
                iTable_RawItems.EnsureVisible(0, 0);
                iTable_RawItems.TableModel.Selections.SelectCell(0, 0);
            }

            iTable_RawItems.EndUpdate();
        }