开发者

Accessing Treeview from a dllplugin. C#

开发者 https://www.devze.com 2023-02-02 02:47 出处:网络
I am writing a plugin for an app that needs to access the client\'s treeview.What is the best way to开发者_如何学编程 do this?Would it simply be the case of passing the treeview reference through to t

I am writing a plugin for an app that needs to access the client's treeview. What is the best way to开发者_如何学编程 do this? Would it simply be the case of passing the treeview reference through to the dll?

The plugin will need to update the treeview based on data being uploaded to a database from the plugin. When this data is uploaded, additional nodes will require to be added to the treeview. I have methods that fulfil this functionality within the client, however I need this to be achieved through the dll.

Thanks.


I think that the best way to achieve this is changing the architecture a bit. Your component that monitors database should declare an event i.e: RecordsAdded. The treeview should add its own handler to that event, which would update its content as desired. Possibly there should be more tiers, but that is just an idea, not a complete solution.


A good solution (which I actually used myself) is to do like IIS 7 do and let the user register "hierarchy providers" that manipulate the nodes in the tree.

You can read more about the IIS 7 tree manipulation and get some inspiration here: http://blogs.msdn.com/b/carlosag/archive/2006/08/12/extendingtreeview.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号