我正在使用 a来CheckedListBox显示. 我正在使用:ListPluginEventHandler
private void myCheckedListBox_SelectedIndexChanged(object sender, EventArgs e)
{
myGUIUtilities.SetDescription(myCheckedListBox.SelectedItem, myRichTextBox);
}
显示一些东西......这是myGUIUtilities.SetDescription方法:
internal static void SetDescription(object p_SelectedObject, RichTextBox p_TextBoxDescription)
{
AbstractEnvChecker l_Plugin = p_SelectedObject as AbstractEnvChecker;
if (l_Plugin != null)
p_TextBoxDescription.Text = l_Plugin.Description;
}
为了显示我的插件,我只使用了以下CheckedListBox.Items.Add方法:
MyCheckedListBox.Items.Add(myPlugin);
接受一个对象作为参数...
现在我想Plugins按 cetgories 对我进行分类,所以我使用TreeViewand TreeNode。
问题是TreeView.Nodes.Add(TreeNode node)只接受TreeNodeType 作为参数。
而且我实际上不能使用SetDescription需要Plugin类型来获取Plugin.Description属性的相同方法......
有没有办法将对象传递给TreeView.Nodes.Add(TreeNode node)方法?或者另一种方式来做到这一点?