Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I would like to get all the text of an active textView in Visual Studio text editor,See the Code,in the Method OnRegisterView of the class TextManagerEventSink,I want to do something with "pView" to get all the text.I have looked up all the Method of the IVsTextView interface, however, nothing useful,Could anyone help me ?
C#
public class TextManagerEventSink : IVsTextManagerEvents
       {
           public void OnRegisterMarkerType(int iMarkerType)
           {

           }
           public void OnRegisterView(IVsTextView pView)
           {

               CommandFilter filter = new CommandFilter();
               pView.AddCommandFilter(filter, out filter.NextCommandTarget);


           }

           public void OnUnregisterView(IVsTextView pView)
           {
           }

           public void OnUserPreferencesChanged(VIEWPREFERENCES[] pViewPrefs, FRAMEPREFERENCES[] pFramePrefs, LANGPREFERENCES[] pLangPrefs, FONTCOLORPREFERENCES[] pColorPrefs)
           {
           }
       }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900