Hello everyone,
I just implemented a really simple ToolboxItem:
private class MyToolboxItem : ToolboxItem
{
public override string ComponentType
{
get { return "HTML Fragment"; }
}
public TcWebHmiToolboxItem(String name)
{
DisplayName = name;
Description = "My first Toolbox item.";
}
}
When I create few instances of it, the created items are not shown for specific document types, e.g. HTML documents. When I open a HTML file, for example "index.html", than the Toolbox is cleaned automatically and only the categories "HTML" and "General" are shown. For other file types, for example any *.cs file, the Toolbox shows a lot of Toolbox items, some are deactivated but most are activated.
There is no way for activating the Toolbox items manually, or to show specific categories manually.
My code for adding Toolbox items is:
IToolboxService ts = GetService(typeof(IToolboxService)) as IToolboxService;
if (ts != null)
{
ts.AddToolboxItem(new MyToolboxItem ("Hello world!"), "MyCategory");
}
ts.Refresh();
Do I need to implement some filter?