This repository was archived by the owner on Oct 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 794
How to add a key definition to the editor
jonathanstrange edited this page Sep 4, 2007
·
3 revisions
{BR} Its quite straight forward to add some functionality to the SharpDevelop editor. But there are a few steps. Each key must be assigned to a class that inherits from AbstractEditCommand. So for each key you must define a class. In the addin file you will assign that key to the class. {BR}{BR} The following is an example of adding navigate back and forward to the test editor. {BR}{BR} The addin project name I use is MyKeySettings. These instructions are based off of that name.{BR}{BR}
- First you will need to create a SharpDevelop AddIn project.{BR}{BR}
- Edit the addin file ( in this case MyKeySettings.addin).{BR}{BR}
- Remove:{BR}
{{ <esc><Path name = "/SharpDevelop/Workbench/Pads"> <Pad id = "MyKeySettingsPad" category = "Main" title = "MyKeySettingsPad" icon = "PadIcons.Output" shortcut = "Control|Alt|T" class = "MyKeySettingsPad.TestPad"/> </Path></esc>
}}{BR}{BR}
- Add the following to the addin file:{BR} `{{
}
public class MyNavigateBackwards : AbstractEditAction { public override void Execute(TextArea textArea) { StatusBarService.SetMessage("back"); NavigationService.Go(-1); }
`}}}{BR}{BR}
- You will also need to set the output of your project to the sharpdevelop addin directory in a subdirectory named like your project. (Project properties, Compile tab). {BR}{BR} Works for me, if you have problems ask on the forums or email me.