项目目录的扩展点

Extension point for project directories

我想编写一个加载项来检出 SVN 存储库。计划是用户右击一个目录,点击"SVN Checkout"。加载项要求提供其 URL 和修订号。确定后,加载项调用 "svn co -r xxx URL"、显示结果并刷新目录。

刚开始学习Monodelect的插件编写,目前看到的资料不多,想请教下项目目录的context menu的扩展点是什么?

这记录在 MonoDevelop website

不过,最好的办法是查看 MonoDevelop source code

项目上下文菜单的扩展点是:

<Extension path = "/MonoDevelop/Ide/ContextMenu/ProjectPad">

在其中您可能需要添加带有条件的命令,以便它只出现在目录中:

<Condition id="ItemType" value="IFolderItem">
    <CommandItem id = "YourNamespace.YourCommandId" />
</Condition>

然后您可以使用处理程序定义您的命令。

<Extension path = "/MonoDevelop/Ide/Commands/Project">
    <Command
        id = "YourNamespace.YourCommandId"
        _description = "desc"
        _label = "your label"
        defaultHandler = "YourNamespace.YourHandler" />
</Extension>

YourHandler 将从 MonoDevelop.Components.Commands.CommandHandler 派生并覆盖 运行 方法。