alvin.chen
2019-11-29 edf127edc771f715c49f86e91e768633f0a0ed93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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));
                }
            }
        }
    }
}