I am listening on TextViewCreated from IWpfTextViewCreationListener interface.
How can I use the IWpfTextView I get as a parameter to differentiate between textview belonging to the “code definition window” and the normal text editor?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is the basic code to accomplish this.
The
IVsEditorAdaptersFactoryServiceis a MEF importable component so it’s available via[Import]on your MEF container.The
IVsCodeDefViewis an older Visual Studio service. If you have anIServiceProviderit’s available viaQueryService(be sure to useSVsServiceProvideras the service type andIVsServiceProvideras the interface).