public HeapCell EmbeddedReference(uint aAddress)
        {
            HeapCell ret = null;

            //
            if (ContainsEmbeddedReference(aAddress))
            {
                RelationshipInfo info = iEmbeddedReferencesTo[aAddress];
                ret = info.ToCell;
            }
            //
            return(ret);
        }
        internal void AddEmbeddedReferenceTo(RawItem aRawItemInThisCell, HeapCell aToCell)
        {
            System.Diagnostics.Debug.Assert(aRawItemInThisCell.Tag == null);

            if (ContainsEmbeddedReference(aToCell) == false)
            {
                // Make reference description
                RelationshipInfo referenceTo = new RelationshipInfo(iCell, aRawItemInThisCell, aToCell);

                // Set up relationship between a raw item in this cell and
                // the specified other cell.
                aRawItemInThisCell.Tag = referenceTo;

                // This cell now contains a reference to the other cell.
                iEmbeddedReferencesTo.Add(aToCell.Address, referenceTo);

                // aAnotherCell has been referenced by 'me'
                aToCell.RelationshipManager.ReferencedBy.Add(Parent);
            }
            else
            {
                //System.Diagnostics.Debug.WriteLine( "PREVENTING CYCLIC LINK - Cell: 0x" + aCell.Address.ToString("x8") + " already contains a linkRef to: 0x" + cell.Address.ToString("x8") );
            }
        }
        private void OnStateBody()
        {
            const int KDWordsPerLine = 4;

            int rawItemsCount = iCell.RawItems.Count;

            for (int i = 0; i < rawItemsCount; i += KDWordsPerLine)
            {
                RawItem rawItem = iCell[i];

                // Start new row
                WriteTableRowBegin();

                // Address
                WriteTableColumnBegin();
                WriteAnchorWithName(rawItem.Address.ToString("x8"));
                Writer.Write("0x" + rawItem.Address.ToString("x8"));
                WriteTableColumnEnd();

                // Blank spacer
                WriteTableColumnBegin(TAlignment.EAlignNone, string.Empty, 20);
                WriteSpace();
                WriteTableColumnEnd();

                // Work out how many items on this line
                int runIndex;
                int runExtent = i + KDWordsPerLine;

                // First set of columns - original data
                for (runIndex = i; runIndex < runExtent; runIndex++)
                {
                    // Get the item
                    if (runIndex < rawItemsCount)
                    {
                        rawItem = iCell[runIndex];

                        // Does the raw item have a linked cell associated with it?
                        if (rawItem.Tag != null && rawItem.Tag is Relationships.RelationshipInfo)
                        {
                            Relationships.RelationshipInfo relationshipInfo = (Relationships.RelationshipInfo)rawItem.Tag;
                            HeapCell associatedCell = relationshipInfo.ToCell;

                            string url          = "javascript:showMainFormCell(\'" + associatedCell.Address.ToString("x8") + "\')";
                            string windowTarget = "MainWindow";
                            string toolTipTitle = "Link to ";
                            if (associatedCell.Symbol != null)
                            {
                                toolTipTitle += associatedCell.Symbol.NameWithoutVTablePrefix;
                            }
                            else
                            {
                                toolTipTitle += "Cell";
                            }
                            string toolTipBody     = ToolTipBody(associatedCell);
                            string linkText        = rawItem.OriginalData.ToString("x8");
                            string linkWithToolTip = HeapToHTMLPageJavaScriptManager.MakeToolTipLink(toolTipTitle, toolTipBody, url, windowTarget, linkText);

                            WriteTableColumnBegin(TAlignment.EAlignCenter, "cellDataAsNumeric");
                            WriteLine(linkWithToolTip);
                            WriteTableColumnEnd();
                        }
                        else
                        {
                            WriteTableColumnHex(rawItem.OriginalData, TAlignment.EAlignCenter, "cellDataAsNumeric");
                        }
                    }
                    else
                    {
                        WriteTableColumnEmpty();
                        rawItem = null;
                    }
                }

                // Blank spacer
                WriteTableColumnBegin(TAlignment.EAlignNone, string.Empty, 20);
                WriteSpace();
                WriteTableColumnEnd();

                // Second set of columns - characterised data
                for (runIndex = i; runIndex < runExtent; runIndex++)
                {
                    // Get the item
                    if (runIndex < rawItemsCount)
                    {
                        rawItem = iCell[runIndex];
                        WriteTableColumn(rawItem.OriginalCharacterisedData, TAlignment.EAlignCenter, "cellDataAsString");
                    }
                    else
                    {
                        WriteTableColumnEmpty();
                        rawItem = null;
                    }
                }
            }

            WriteTableRowEnd();
        }