/// <summary> /// Open the file according to column name with the editor. /// Copies the function name to Clipboard /// </summary> /// <param name="sender"></param> /// <param name="columnNameFilePath"></param> /// <param name="columnNameLineNumber"></param> private void StartCodeFile(object sender, string columnNameFilePath, string columnNameLineNumber = "") { // Get the control that is displaying this context menu DataGridView grid = GetDataGridView(sender); var row = grid.SelectedRows[0]; string filePath = row.Cells[columnNameFilePath].Value.ToString(); filePath = Path.Combine(_folderCodeRoot, filePath); // Copy Function name to Clipboard string functionName = row.Cells["Implementation"].Value.ToString().Trim() != "" ? row.Cells["Implementation"].Value.ToString() : row.Cells["Interface"].Value.ToString(); if (string.IsNullOrEmpty(functionName)) { Clipboard.SetText(functionName); } // Estimate line number var lineNumber = columnNameLineNumber == "" ? GetLineNumber(filePath, functionName).ToString() : row.Cells[columnNameLineNumber].Value.ToString(); lineNumber = lineNumber != "-1" ? $":{lineNumber} -g" : ""; HoUtil.StartApp($"Code", $"{filePath}{lineNumber}"); }