Buggy implementation of Custom BrowserNodes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When you have created a custom browser pane and you want to insert a custom browser node, you'll have to create a "BrowserNodeDefinition" using the "BrowserPanes.CreateBrowserNodeDefinition" first, before you can then apply this newly created BrowserNodeDefinition to your new BrowserNode, which is created using the "BrowserNode.AddChild-method". The "CreateBrowserNodeDefinition" requires a unique ID wich is not automatically generated, but has to be supplied by the caller.
So, how will you know, which is the next free BrowserNodeDefinition-ID that can be applied?
There is no BrowserNodeDefinitions-Enumerator which you can iterate through to figure out, which IDs are allready in use, and which can be applied next. Instead, there is a "GetClientBrowserNodeDefinition"-Function, which requires the ID of the desired BrowserNodeDefinition as argument. Har har!
Yet I helped myself by iterating through the BrowserNodes themselves and their applied BrowserNodedefinition, to obtain the next free ID.
This works fine, as long as you don't start deleting BrowserNodes that have been created before:
The help to the "BrowserNode.Delete"-method claims:
"None of the corresponding browser node definitions nor the client node resources are deleted, however".
Thus, your BrowserNode is gone, but the definition is still there, and the only way to get hold of that definition is by querying it by it's ID - which you might not know any more!
So how on earth am I supposed to figure out, which new ID i will have to apply, if i want to create another new Browsernode???
Or, to put the cart before the horse: how do i get rid of the orphaned BrowserNodeDefinitions?
Plus, the quotation from the help above does also claim, it will not delete the ClientNodeResource. Apparently, it does so, despite the help saying it won't. At least, when the last BrowserNode referring to a certain BrowserNodeResource has been deleted, the respective BrowserNodeResource is not acessible through the API any more. (Yes, it may still resides inside the XmBrowserSegment, but what it's worth for, if I can't access it any more?)
Any suggestions (Except for counting the occupied IDs somewhere else on my own)?