mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Force file watcher to close when file is either saved or canceled
This commit is contained in:
parent
d5b57b2ad6
commit
1e78c7950f
1 changed files with 4 additions and 6 deletions
|
@ -265,7 +265,7 @@ namespace Toolbox.Library.Forms
|
|||
FileWatcher = new FileSystemWatcher();
|
||||
FileWatcher.Path = Path.GetTempPath();
|
||||
FileWatcher.NotifyFilter = NotifyFilters.Size | NotifyFilters.LastAccess | NotifyFilters.LastWrite;
|
||||
FileWatcher.EnableRaisingEvents = true;
|
||||
FileWatcher.EnableRaisingEvents = false;
|
||||
FileWatcher.Changed += new FileSystemEventHandler(OnFileWatcherChanged);
|
||||
FileWatcher.Filter = "";
|
||||
}
|
||||
|
@ -1099,11 +1099,9 @@ namespace Toolbox.Library.Forms
|
|||
SaveAndApplyImage(new Bitmap(FileName), DecodeTextureBack);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FileWatcher.Filter = "";
|
||||
FileWatcher.EnableRaisingEvents = false;
|
||||
}
|
||||
|
||||
FileWatcher.Filter = "";
|
||||
FileWatcher.EnableRaisingEvents = false;
|
||||
}
|
||||
|
||||
public void SaveAndApplyImage(Bitmap image, bool DecodeBack)
|
||||
|
|
Loading…
Reference in a new issue