locked
custom editor custom view type command for multiple document view RRS feed

  • Question

  • Hi,

    I have created a custom file extension and a custom editor for that. Now I want to add multiple document view for my file extension. So that in Server explorer when user right click the file it should show options like "View customName1", "View customName2", "View CustomName3". Each of these will open the file in a different WPF form.

    Regards

     


    singhhome
    Tuesday, August 3, 2010 5:40 PM

Answers

  • Hello,

    I'm not sure I understand you clearly, if I misundrstood you, please let me know.

    Based on my understanding, you want to add several menus in context menu when you right click file in Solution Explorer. If so, please refer to David DeWinter's article:

    Dynamic Menu Commands in Visual Studio Packages

    ->Each of these will open the file in a different WPF form.

    You can do your actions in clicking your custom menu event.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by singhhome Friday, August 6, 2010 5:12 PM
    Wednesday, August 4, 2010 3:20 AM

All replies

  • Hello,

    I'm not sure I understand you clearly, if I misundrstood you, please let me know.

    Based on my understanding, you want to add several menus in context menu when you right click file in Solution Explorer. If so, please refer to David DeWinter's article:

    Dynamic Menu Commands in Visual Studio Packages

    ->Each of these will open the file in a different WPF form.

    You can do your actions in clicking your custom menu event.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by singhhome Friday, August 6, 2010 5:12 PM
    Wednesday, August 4, 2010 3:20 AM
  • Thanks Nancy for reply.

     

    Does that mean that to open my file in multiple type of views(wpf forms), i don't need to handle multiple calls(one per view) to IVsEditorFactory.CreateEditorInstance()?

    I thought i have to implement CreateEditorInstance(), and based on the value of parameter "pszPhysicalView",  I need to open the appropriate WPF form. For example

    if(pszPhysicalView == "my Name1")

    EditorPane1()//WPF form1

    else if(pszPhysicalView == "MyName2")

    EditorPane2(); //wpf form2

    But now from your post i am guess, that I have to handle click of cutom menu item event, and not createEditorInstance.

    Regards

     


    singhhome
    Wednesday, August 4, 2010 5:56 AM