I would suggest saving the result of base.Remove(file.Name) to a local
variable so you can inspect it in the debugger and then be absolutely
sure that it's return true as you suspect.
bool removed = base.Remove(file.Name);
if (removed && OnFileRemoved != null) {
OnFileRemoved(this, file);
}
HTH,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On Tue, 31 Oct 2006 15:50:14 +0200, Asko Telinen <mr*****@hotmail.com>
wrote:
>
Hi all.
I ran into quite strange problem concerning the event raising inside
FileSystemWatcher Delete event.
protected override void CMyCollection::Remove(DMFile file) {
if ( base.Remove(file.Name) && OnFileRemoved != null ) {
OnFileRemoved(this, file);
}
}
So far so good. Now, when the DirStruct object receives a filesystem
Create or Delete notification, it calls those methods respectively and
everything works just fine EXCEPT, the Remove method in MY class will
never called. Even though item is removed from collection. On the