IsThisApplicationCurrentlyActive() public static méthode

public static IsThisApplicationCurrentlyActive ( ) : bool
Résultat bool
Exemple #1
0
 private void Events_FileChangedInGameFolder(string fileName)
 {
     if (fileName.ToLower() == _script.FileName.ToLower())
     {
         if (DateTime.Now.Subtract(_script.LastSavedAt).TotalSeconds > 2)
         {
             if (Utilities.IsThisApplicationCurrentlyActive())
             {
                 PromptUserThatFileHasChangedExternally();
             }
             else
             {
                 _fileChangedExternally = true;
             }
         }
     }
 }
Exemple #2
0
 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;
             }
         }
     }
 }