using System.Diagnostics;
|
using System.Threading;
|
|
namespace LLMF
|
{
|
public class StarterTool
|
{
|
public static bool IsExistMutex(string mutexName, out Mutex mutex)
|
{
|
bool flag;
|
mutex = new Mutex(true, mutexName, out flag);
|
return !flag;
|
}
|
|
public static bool IsSingle()
|
{
|
return (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length <= 1);
|
}
|
|
public static void PowerWait(string[] args)
|
{
|
if ((((args != null) && (args.Length > 1)) && args[0].ToUpper().Equals("-S")) && (args[1] != null))
|
{
|
int result = 0;
|
if (int.TryParse(args[1], out result) && (result > 0))
|
{
|
Thread.Sleep((int) (result * 0x3e8));
|
}
|
}
|
}
|
}
|
}
|