1

I'm trying to create multiple files from inside a VSPackage plugin. When the code runs, each time a new file is created, the environment tries to load it into a default designer. This considerably (and needlessly) slows down the plugin's execution.

I tried setting DTE.SuppressUI property to true, but it didn't have any effects.

public void Generate()
{
    _dte.SuppressUI = true;

    try
    {
        _innerGenerator.Generate();
    }
    finally
    {
        _dte.SuppressUI = false;
    }
}

What else am I supposed to do to prevent the UI to refresh itself?

Crono
  • 10,211
  • 6
  • 43
  • 75
  • Are you just adding those files to the solution or trying to open them as well? – Vlad Feinstein Nov 17 '15 at 16:10
  • @VladFeinstein I actually wish I had a way to keep them from opening but it seems that it depends on the kind of project the code runs on. In C# projects it works just fine, but in DB projects every new file added to the project opens up itself by default. Either way, I want to prevent the UI from refreshing itself, whether we're talking about documents or the solution explorer. – Crono Nov 17 '15 at 20:02

0 Answers0