private void Events_FileChangedInGameFolder(string fileName)
{
if (fileName.ToLower() == _script.FileName.ToLower() &&
!_script.IsBeingSaved)
{
if (DateTime.Now.Subtract(_script.LastSavedAt).TotalSeconds > 2)
{
if (!Utilities.IsMonoRunning() && Utilities.IsThisApplicationCurrentlyActive())
{
//On Mono can't use the Win API to check if application is in focus.
//Hopefully the prompt will be triggered by its second usage,
//when the main window is activated.
PromptUserThatFileHasChangedExternally();
}
else
{
_fileChangedExternally = true;
}
}
}
}