private void LinkLabels() { var labelCol = m_HeaderCols["Label"]; var asmCol = m_HeaderCols["ASM"]; for (int row = 2; row <= m_Worksheet.Dimension.Rows; ++row) { var asmCell = m_Worksheet.Cells[row, asmCol]; var label = AsmUtils.GetJumpToLabel(asmCell.Text); if (string.IsNullOrEmpty(label)) { continue; } int labelRow; if (m_LabelRows.TryGetValue(label + ":", out labelRow)) { var linkCell = m_Worksheet.Cells[labelRow, asmCol]; asmCell.Hyperlink = new ExcelHyperLink(linkCell.Address, asmCell.Text); asmCell.StyleName = "Hyperlink"; } else { asmCell.Hyperlink = null; asmCell.StyleName = "Normal"; } } }
private HashSet <JumpSet> FindJumpSets() { var jumpSets = new Dictionary <int, JumpSet>(); var labelCol = m_HeaderCols["Label"]; var asmCol = m_HeaderCols["ASM"]; for (int row = 2; row <= m_Worksheet.Dimension.Rows; ++row) { var asmCell = m_Worksheet.Cells[row, asmCol]; var label = AsmUtils.GetJumpToLabel(asmCell.Text); if (string.IsNullOrEmpty(label)) { continue; } int labelRow; if (!m_LabelRows.TryGetValue(label + ":", out labelRow)) { continue; } JumpSet jumpSet; if (!jumpSets.TryGetValue(labelRow, out jumpSet)) { jumpSet = new JumpSet(labelRow); jumpSets[labelRow] = jumpSet; } jumpSet.AddSource(row); } return(new HashSet <JumpSet>(jumpSets.Values)); }