Editor in a Toolwindow

This sample shows how to host the Visual Studio 2010 editor within a toolwindow.

 
 
 
 
 
(5)
4,283 times
Add to favorites
3/1/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Create an editor of ContextType("MyEditor")
    3 Posts | Last post October 24, 2012
    • Can you expand on this sample to show how to create an editor of my own ContextType in a tool window?
      
      I've gone through the sample and I can create it creates an editor of ContextType("TEXT") but I have not been able to figure out how to get my own ContextType to show up.
      
      Thanks,
      
      
    • Try changing the line:
                  bufferAdapter = m_EditorAdapterFactory.CreateVsTextBufferAdapter(oleServiceProvider, bufferFactory.TextContentType);
      
      to:
                  var _contentTypeRegistryService = m_componentModel.GetService<IContentTypeRegistryService>();
                  var types = _contentTypeRegistryService.GetContentType("C/C++");
                  bufferAdapter = m_EditorAdapterFactory.CreateVsTextBufferAdapter(oleServiceProvider, types);
      
      This will give the editor window C/C++ style syntax highlighting.  You can also use "CSharp" IIRC.
      
      Hope that helps,
      -M
    • Hi,
      I tried changing the content type as suggested to "CSharp" but not seeing any syntax highlighting.
      Also, does the editor have intellisense support?
      Thanks