File modification, how to notify IDE in .NET 2003 IDE programatically

  • Thread starter Thread starter nandibhatla
  • Start date Start date
N

nandibhatla

Hi,

I would like to know the following things related to Visual Studio
6.0 / 2003.

a. How does Visual Studio IDE come to know that a particular file has
been modified externally. How it keeps track of the files (ex. by
using some dirty flag)

b. Is there anyway we can notify the IDE that a file has been modified
externally ( which is open in the IDE currently)

Thanks,
Tejas
 
Don't know answer to Q2, but in reference to your 1st question, you can use
the FileSystemWatcher class to 'watch' files in a particular directory.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
 
You ( Tejas ) asked:
" How does Visual Studio IDE come to know
that a particular file has been modified externally.
How it keeps track of the files (ex. by using some dirty flag)

I use VS2005, but I think 2003 is the same.
When editing a file, there's an asterisk to the right of
the file name ( in the tab ) if it has unsaved changes.

On an " Activate App " event ( i.e. when an app gains focus )
VS checks if an open file has been modified externally.

In " Options --> Environment --> Documents ", check:

_ Detect when file is changed outside the environment.
_ Auto-load changes, if saved.

If the file you are editing isn't " dirty ",
VS automatically loads the externally modified file.
Hitting control-Z twice undoes the re-load.

Hitting control-Y will redo it.
..+.+.+
 
Back
Top