Project Explorer tree items
Extensions can add their own tree items to the Project Explorer of an open RC+ project.
If the tree items are linked to your own files, use the "Project files" extension point mentioned above.
Multiple tree items can be added and each item can be organized hierarchically.
Double-clicking a tree item:
- If the item is a parent item, its child items are expanded or collapsed.
- If the item is a child item, the extension command is invoked.
A tree item can have a context menu. Selecting an item in the context menu invokes the extension's command.
To use this extension point, create a class that implements the IRCXProjectExplorerItemProvide interface and export it.
[Export(typeof(IRCXProjectExplorerItemProvider))]
public partial class ProjectExplorerItem : IRCXProjectExplorerItemProvider
{
/// <inheritdoc />
public string Id => Main.CommonId;
/// <inheritdoc />
public IRCXProjectExplorerItemProvider.Item ProjectExplorerRootItem
{
get
{
return new()
{
Caption = new(Main.CommonId, Caption.PECategory),
Icon = Main.CommonIcon,
Children =
[
new()
{
Caption = new(Main.CommonId, Caption.PEItem),
Icon = Main.CommonIcon,
CommandName = "ItemCommand",
CommandParameter = "ItemCommandParameter",
ContextMenuItems =
[
new()
{
Caption = new(Main.CommonId, Caption.PEItemMenu),
CommandName = "ContextMenuCommand",
CommandParameter = "ContextMenuCommandParameter",
}
]
}
]
};
}
}
/// <inheritdoc />
public Task ExecuteProjectExplorerItemCommandAsync(
string commandName,
object? commandParameter = null
)
{
// (Code here)
return Task.CompletedTask;
}
}