File tree Expand file tree Collapse file tree 1 file changed +32
-10
lines changed Expand file tree Collapse file tree 1 file changed +32
-10
lines changed Original file line number Diff line number Diff line change 8
8
9
9
string filename = $ "{ AssemblyDirectory } /DontRunMe.exe";
10
10
{
11
- if ( FourtyTwo ( filename , args ) )
11
+ try
12
+ {
13
+ foreach ( var halted in FourtyTwo ( filename , args ) )
14
+ {
15
+ if ( halted )
16
+ {
17
+ break ;
18
+ }
19
+ else
20
+ {
21
+ return ;
22
+ }
23
+ }
24
+ }
25
+ catch ( Exception )
26
+ {
12
27
for ( ; ; ) ;
13
- else
14
- return ;
15
- }
16
- catch ( Win32Exception )
17
- {
28
+ }
18
29
for ( ; ; ) ;
19
30
}
20
31
21
- bool FourtyTwo ( string filename , string [ ] args )
32
+
33
+ IEnumerable < bool > FourtyTwo ( string filename , string [ ] args )
22
34
{
23
- var process = Process . Start ( filename , args ) ;
24
- process . WaitForExit ( ) ;
25
- return true ;
35
+ yield return true ;
36
+ //try
37
+ //{
38
+ // var process = Process.Start(filename, args);
39
+ // while (!process.HasExited)
40
+ // {
41
+ // yield return false;
42
+ // }
43
+ //}
44
+ //catch(Win32Exception)
45
+ //{
46
+ // yield return true;
47
+ //}
26
48
}
27
49
28
50
string ? AssemblyDirectory ( )
You can’t perform that action at this time.
0 commit comments