-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunBatchOptimization.cs
More file actions
44 lines (43 loc) · 1.18 KB
/
RunBatchOptimization.cs
File metadata and controls
44 lines (43 loc) · 1.18 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VMS.TPS.Common.Model.API;
namespace VMS.TPS
{
public class Script
{
public Script()
{
}
[MTAThread]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Execute(ScriptContext context)
{
string locPath = Path.GetDirectoryName(GetPath());
Process proc = new Process();
proc.StartInfo.FileName = Path.Combine(locPath, "BatchOptimization.exe");
proc.StartInfo.Arguments = "";
proc.StartInfo.UseShellExecute = true;
//proc.StartInfo.RedirectStandardError = true;
//proc.StartInfo.RedirectStandardOutput = true;
try
{
proc.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
static public string GetPath([CallerFilePath] string fileName = null)
{
return fileName;
}
}
}