Visual Studio Developer Center > Visual Studio Forums > Visual Studio Extensibility > Custom Designer w/IVsFindTarget, behavior of Quick Find in Solution/Project
Ask a questionAsk a question
 

QuestionCustom Designer w/IVsFindTarget, behavior of Quick Find in Solution/Project

  • Wednesday, November 04, 2009 4:51 PMFBNitro Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Visual Studio 2008 SP1
    VS SDK 2008 1.1
    This package is running under the isolated shell environment.

    I have a designer where users can drag/drop controls around etc.  The file is saved in an XML format (with a custom extension on it).  I've implemented the IVsFindTarget interface.  If I have my designer editor open and perform a find, it will highlight the control on the screen that matches the search criteria, highlight the next one etc.  Which is great, if I search the current document or search all open documents.

    If I do a search for Entire Solution or Current Project (and my editor is closed), instead of opening my editor when a match is found (mine is set as the primary editor), it opens the Text editor.  We do not want to expose this to our customers.

    I need to either:
    a) Have the find engine open my editor when it finds a match in a file, instead of the text editor.
    b) Find a way to disable searching on Solution/Project  (I don't like this, but it's better than what would happen otherwise).

    If I can't do either, then I'll need to disable find completely (which I know how to do in the Shell), but that is a huge usability issue for our other editors that are text based.
    • Edited byFBNitro Wednesday, November 04, 2009 5:25 PMtypo
    •  

All Replies

  • Friday, November 06, 2009 6:33 AMChao KuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,
    Is your editor is done by the winform designer? What do you mean by open by "opens text editor"? Have you provide your editor extension using ProvideEditorExtensionAttribute? If you do this, the VS will open your file with your custom editor not the Text Editor.
    Thanks
    Chao
  • Friday, November 06, 2009 3:35 PMFBNitro Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Yes, the editor itself works fine, yes it's registered correctly etc. The only time it does not work as expected is during a find operation.

    Detailed Steps:
    1) Open my designer
    2) Layout a control and put the word "Bob" in the label
    3) Save and Close the designer
    4) Open the find window (Ctrl-F)
    5) Find the word "Bob" in the "Entire Solution"

    Expected Behavior:
    It finds it in the file that was just saved and opens the file with my custom Designer.

    Actual Behavior:
    It finds it in the file that was just saved, ignores the designer associated with the extension, and opens the file with the default text (code) editor in studio.


    Note:
    If I repeat the same steps as above but leave the editor open in Step 3 instead of closing it, it has the correct behavior.