How to rename a node by code like we press F2

Hi,

I want to add a context menu to a node with a command of rename.
How do i get into a rename mode on a node by code like we press F2 on a node?

thanks,

Make sure the desired Node is selected and then call Diagram.CommandHandler.Edit().