Excel-DNA / Excel-DNA/ExcelDnaDoc
Code to add shortcut key information to model
- Dominant language
- HTML
- Stars
- 35
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
While I do understand this is not the best or proper way to request a code change, but since I'm terrible at git and have never worked with pull requests, here it is.
Can the following code or something along its lines be added to ModelHelper.cs on line 35? It adds the neccessary information for the template to actually display key combinations.
if (excelCommand.ShortCut != null)
{
System.Text.RegularExpressions.Match match = System.Text.RegularExpressions.Regex.Match(excelCommand.ShortCut, "^[\\^\\+\\%\\s]*([^\\^\\+\\%\\s]+)$");
if (match.Success)
{
string shortcutKeys = string.Empty;
if (excelCommand.ShortCut.Contains("^"))
shortcutKeys = "Ctrl ";
if (excelCommand.ShortCut.Contains("+"))
shortcutKeys += "Shift ";
if (excelCommand.ShortCut.Contains("%"))
shortcutKeys += "Alt ";
shortcutKeys = shortcutKeys.TrimStart().Replace(" ", " + ");
shortcutKeys += match.Groups[1].Value;
command.ShortCut = shortcutKeys;
}
}
Regards,
Sascha Sanches
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.