locked
save Tools->Options programmatically RRS feed

  • Question

  • Greetings.

    Is there a way to programmatically save the user's changes, made in that dialog ("Source Control" node, if specifically)? The problem is that if I change "Current source control plug-in" and since that time Visual Studio crashes -- this change wouldn't be saved... This is pretty strange because if I change "Environment->General->Show status bar" option -- it became saved immediately.

    Best regards...
    Friday, June 19, 2009 10:15 AM

Answers

  • Hi Hunter,

    If you want to programmatically to get/set the property value under Tools->Properties, you can use  EnvDTE.DTE.Properties method, which returns an indexed EnvDTE.Properties object. For example:

     // DTE dte 
    EnvDTE.Properties txtEdCS = dte.get_Properties( "TextEditor", "CSharp" ); 
    


    For more information, you can refer to the following article:

    But if you just want to keep the the user's setting in Tools->Properties when next time open, Visual Studio will save these settings, you don't need to write some code to save these.

    If I misunderstood you, or you have any questions, please let me know.

    Best Regards,
    Nancy


    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 Nancy Shao Friday, June 26, 2009 7:31 AM
    Tuesday, June 23, 2009 9:12 AM
  • Most (if not all) of the Tools.Options page settings are read during IDE startup, and saved during IDE shutdown. I don't believe there is a way to force these settings to be persisted (typically to the registry) outside of shutting down the IDE.

    Sincerely,


    Ed Dore
    Wednesday, June 24, 2009 4:39 AM

All replies

  • Hi Hunter,

    If you want to programmatically to get/set the property value under Tools->Properties, you can use  EnvDTE.DTE.Properties method, which returns an indexed EnvDTE.Properties object. For example:

     // DTE dte 
    EnvDTE.Properties txtEdCS = dte.get_Properties( "TextEditor", "CSharp" ); 
    


    For more information, you can refer to the following article:

    But if you just want to keep the the user's setting in Tools->Properties when next time open, Visual Studio will save these settings, you don't need to write some code to save these.

    If I misunderstood you, or you have any questions, please let me know.

    Best Regards,
    Nancy


    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 Nancy Shao Friday, June 26, 2009 7:31 AM
    Tuesday, June 23, 2009 9:12 AM
  • I know how to change properties. I don't know how to save those changes without closing Visual Studio.

    As I've wrote: if I change source control plug-in and kill Visual Studio next time there will be previous plug-in selected...
    Tuesday, June 23, 2009 1:49 PM
  • Most (if not all) of the Tools.Options page settings are read during IDE startup, and saved during IDE shutdown. I don't believe there is a way to force these settings to be persisted (typically to the registry) outside of shutting down the IDE.

    Sincerely,


    Ed Dore
    Wednesday, June 24, 2009 4:39 AM