BUG: Visual Studio .NET flickers when add-in opens windows in Text view

Article translations Article translations
Article ID: 555195 - View products that this article applies to.
Author: Carlos Quintero MVP
Expand all | Collapse all

SUMMARY

When a Visual Studio .NET add-in processes the files of a project opening windows for the files which are text files (HTML, XML, etc.), the IDE shows a lot of flicker.

SYMPTOMS

When a Visual Studio .NET add-in processes the files of a project opening windows for the files which are text files (HTML, XML, etc.), the IDE shows a lot of flicker. This does not happen with code files.

CAUSE

This seems to be a bug of Visual Studio .NET.

MORE INFORMATION

Steps to reproduce the problem:
 
- Create a new Visual Studio .NET C#  add-in.
 
- Include the following code in the connect class:
 
   public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
   {
      _DTE objDTE;
 
      objDTE = (_DTE) application;
      
      try
      {
         foreach (Project objProject in objDTE.Solution.Projects)
         {
            HandleFiles(objProject.ProjectItems);
         }
         MessageBox.Show("Finished");
      }
      catch (Exception objException)
      {
         MessageBox.Show(objException.ToString());
      }
   }
 
   private void HandleFiles(ProjectItems colProjectItems)
   {
      String sExtension;
      Window objWindow;
 
      foreach (ProjectItem objProjectItem in colProjectItems)
      {
         sExtension = System.IO.Path.GetExtension(objProjectItem.Name);
         switch (sExtension)
         {
            case ".xml":
            case ".htm":
            case ".html":
            case ".css":
            {
               objWindow = null;
               try
               {
                  // Open window in Text view
                  objWindow = objProjectItem.Open(EnvDTE.Constants.vsViewKindTextView);
               }
               catch
               {}
 
               if (objWindow != null)
               {
                  // Simulate workload during some milliseconds
                  System.Threading.Thread.Sleep(40);
 
                  objWindow.Close(EnvDTE.vsSaveChanges.vsSaveChangesNo);
               }
               break;
            }
         }
 
         // Enter in recursion
         HandleFiles(objProjectItem.ProjectItems);
 
      }
 
   }
 
- Run the add-in and in the second IDE instance, create an ASP.NET solution with a couple of dozens of HTML files.
 
- Load the add-in. Notice that while the add-in is processing the HTML files, the IDE shows a lot of flicker.
 
 

Properties

Article ID: 555195 - Last Review: September 16, 2004 - Revision: 1.0
APPLIES TO
  • Microsoft Visual Studio .NET 2002 Enterprise Developer
  • Microsoft Visual Studio .NET 2002 Enterprise Developer
  • Microsoft Visual Studio .NET 2002 Professional Edition
  • Microsoft Visual Studio .NET 2003 Enterprise Architect
  • Microsoft Visual Studio .NET 2003 Enterprise Developer
  • Microsoft Visual Studio .NET 2003 Professional Edition
Keywords: 
kbpubmvp kbpubtypecca kbhowto KB555195
COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com