ACAT.Lib.Core.Utility.FileUtils.CheckAppExistingInstance C# (CSharp) Метод

CheckAppExistingInstance() публичный статический Метод

Checks if the app is already running. The mutex is used to check this
public static CheckAppExistingInstance ( String mutexName ) : bool
mutexName String name of the mutex
Результат bool
        public static bool CheckAppExistingInstance(String mutexName)
        {
            bool retVal = true;
            try
            {
                closeAppMutex();
                _appMutex = Mutex.OpenExisting(mutexName);
                closeAppMutex();
            }
            catch
            {
                //the specified mutex doesn't exist, we should create it
                _appMutex = new Mutex(true, mutexName);
                retVal = false;
            }

            return retVal;
        }