Pablo Galiano : Tuesday, January 09, 2007 - Posts

Subscriptions

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

News

Subscribe to Pablo Galiano by Email

Post Categories

Tuesday, January 09, 2007 - Posts

Persisting user information in Visual Studio

Visual Studio offers a way to persist user information between sessions. This is done by using the Globals object located on the EnvDTE assembly.
The Globals object allows you to store, retrieve, enumerate and persist user information. So the next time the IDE is open this information is restored.
We can persist information at three different levels:

  • VS or IDE
     
    The information is stored in C:\Documents and Settings\<username>\Application Data\Microsoft\Visual Studio\extglobal.dat. These values are persisted each time VS is closed or a Save All operation occurs.

Snippet:

            DTE.Globals["PropertyName"] = value;
            DTE.Globals.set_VariablePersists("PropertyName", true);

  • Solution

The information is stored in the .sln file. These values are persisted when the solution file is saved.

Snippet:

            solution.Globals["PropertyName"] = value;
            solution.Globals.set_VariablePersists("PropertyName", true);

  • Project

The information is stored in the project file. These values are persisted anytime a project is saved.

Snippet:

            project.Globals["PropertyName"] = value;
            project.Globals.set_VariablePersists("PropertyName", true);

One important thing is that Values to be stored must be strings, they cannot be objects or structures because these files are xml files.


Pablo

posted Tuesday, January 09, 2007 6:18 PM by pga with 1 Comments

What Happens When

I would like to start a new series of posts named What Happens When or WHW for now on.

Basically I will try to explain what happens behind the scenes when we do things inside VS and GAX. I think this is very helpful to understand the internal mechanics of VS and GAX and how things work.

So, the first post on this series is:

WHW we register a guidance package?

Answer:

  1. The guidance package project is compiled.
  2. The installer project is compiled and installed using installutil.
    1. An entry for the guidance package is added to the recipe framework manifest located at C:\Documents and Settings\All Users\Application Data\Microsoft\Recipe Framework\RecipeFramework.xml.
      1. This entry contains a timestamp that is used by the runtime to check if a guidance package was altered before loading it.
    2. The following registry entries are created:
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\AutoLoadPackages\<PackageGUID>
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Menus\<PackageName>
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\NewProjectTemplates\PseudoFolders\<PackageGUID>
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\NewProjectTemplates\TemplateDirs\<PackageGUID>
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\CodeExpansions\<LANGUAGE>\Paths\<PackageName>
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\<PackageGUID>
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Projects\<PackageGUID>
    3. A devenv / Setup is done to update menus and commandbars defined in the guidance package (this step requires some time to process).

 

Pablo

posted Tuesday, January 09, 2007 7:08 AM by pga with 1 Comments

OAC is OUT!!!

The orientation aware control (OAC) December CTP was released by Clarius.

These are the higlights:

  • Design multiple UI layouts or skins for a single control or form, graphically and with full Visual Studio designer support.
  • Avoid writing rotation/form factor detection code.
  • Optimize screen usage by hiding control on lower resolution devices, without coding.
  • Familiar developer experience through full integration with .NET Localization: optimize for locale as well as form factor/orientation.
  • Zero-impact on performance, on a par with any localized mobile application.
  • Support for current and future form factors.
  • Multiple platform support: Windows Mobile 2003 SE, Windows CE 5.0, Windows Mobile 5.0

Download it now for free!!!

Pablo

posted Tuesday, January 09, 2007 7:02 AM by pga with 0 Comments