Beispiel #1
0
        private void bbWakeModelRun_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            var h = new WakeModelHandler();
            var path = h.GetPath(_model.SolverOutputDir);
            h.Write(path, _model);

            var p = new Process();
            var currentDir = Path.GetDirectoryName(Application.ExecutablePath);
            p.StartInfo.FileName = Path.Combine(currentDir, "exec", "wake6.exe"); ;
            p.StartInfo.Arguments = String.Format("\"{0}\"", _model.SolverOutputDir);
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.Start();

            string output = p.StandardOutput.ReadToEnd();
            string error = p.StandardError.ReadToEnd();
            p.WaitForExit();
        }
Beispiel #2
0
        private void bbWakeModelRun_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            var h    = new WakeModelHandler();
            var path = h.GetPath(_model.SolverOutputDir);

            h.Write(path, _model);

            var p          = new Process();
            var currentDir = Path.GetDirectoryName(Application.ExecutablePath);

            p.StartInfo.FileName               = Path.Combine(currentDir, "exec", "wake6.exe");;
            p.StartInfo.Arguments              = String.Format("\"{0}\"", _model.SolverOutputDir);
            p.StartInfo.UseShellExecute        = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError  = true;
            p.Start();

            string output = p.StandardOutput.ReadToEnd();
            string error  = p.StandardError.ReadToEnd();

            p.WaitForExit();
        }