hytos / DTI_PID / ID2PSN / SingleInstance.cs @ 333d16cf
이력 | 보기 | 이력해설 | 다운로드 (577 Bytes)
1 | eb41cac4 | esham21 | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading; |
||
6 | using System.Threading.Tasks; |
||
7 | |||
8 | namespace ID2PSN |
||
9 | { |
||
10 | public static class SingleInstance |
||
11 | { |
||
12 | static Mutex mutex; |
||
13 | public static bool Start(string applicationIdentifier) |
||
14 | { |
||
15 | bool isSingleInstance = false; |
||
16 | mutex = new Mutex(true, applicationIdentifier, out isSingleInstance); |
||
17 | return isSingleInstance; |
||
18 | } |
||
19 | public static void Stop() |
||
20 | { |
||
21 | mutex.ReleaseMutex(); |
||
22 | } |
||
23 | } |
||
24 | } |