Access current code pane in Visual Studio Extension

前端 未结 1 1114
死守一世寂寞
死守一世寂寞 2021-02-13 07:13

Im writing a visual studio (2010) extension with a right click menu whilst in a code view. I want to be able to examine the current code from my menu item event handler but have

1条回答
  •  [愿得一人]
    2021-02-13 08:14

    You may be looking for

    Document doc = DTE.ActiveDocument;
    TextDocument txt = doc.Object() as TextDocument;
    

    You should then be able to edit work with the TextDocument as needed.

    0 讨论(0)
提交回复
热议问题