VixenApplication.VixenApplication.RemoveLockFile C# (CSharp) Method

RemoveLockFile() private method

private RemoveLockFile ( ) : bool
return bool
        internal bool RemoveLockFile()
        {
            bool success = false;
            try
            {
                if (Directory.Exists(_rootDataDirectory))
                {
                    var lockFilePath = Path.Combine(_rootDataDirectory, LockFile);
                    if (File.Exists(lockFilePath))
                    {
                        File.Delete(lockFilePath);
                        success = true;
                    }
                }
            }
            catch (Exception e)
            {
                Logging.Error("An error occured removing the profile lock file.", e);
            }

            return success;
        }

Usage Example

Esempio n. 1
0
 private static void LogMessageAndExit(Exception ex)
 {
     // Since we can't prevent the app from terminating, log this to the event log.
     Logging.Fatal(ErrorMsg, ex);
     if (_app != null)
     {
         _app.RemoveLockFile();
     }
     Environment.Exit(1);
 }
All Usage Examples Of VixenApplication.VixenApplication::RemoveLockFile