我正在编写一个AutoCAD插件,它将所有实体显示为TreeView中的节点。我希望能够从Node获取对象以便能够以编程方式工作。这是我点击节点时的代码:
private void treeView1_MouseClick(object sender, MouseEventArgs e)
{
TreeNode node = treeView1.SelectedNode;
propertyGrid1.SelectedObject = node;
/*Entity selectedEntity = node.getObject() as Entity; Pseudo-code, need to know how to do this*/
}