Jeff Mason
7/6/2008 12:47:00 PM
On Sat, 5 Jul 2008 10:26:28 -0400, "Jeff Winn" <jwinn@nospam.com> wrote:
>Are you sure the FileSystemWatcher instance you're using is raising the
>event as expected? I've used them for this same scenario in the past for
>services I've written, and found that the events I expected to be raised
>depended upon which application was editing the config file. IE: Notepad
>fires the Changed event when editing the file, while Visual Studio uses a
>temporary file and then deletes and recreates the file when saved which
>won't fire the Changed event.
>
>You might want to start looking at adding event handlers for all the events,
>and test them individually to see which events are being raised and which
>ones aren't. More than likely that's the problem you're having.
>
I am positive that the correct events are being raised. My event handler
is set to handle the delete, changed, and created events, and that event
properly fires when the .config file is modified. I temporarily placed a
message box in the event handler to see each event and the type of change
and it seems like the events are working correctly.
I do see that the event can sometimes fire multiple times when using notepad
for example. A little strange maybe, but since all I'm trying to to is
execute a RefeshSection, executing it more than once presumably can't hurt.
-- Jeff