public bool GetSimulatorList()
{
bool success = false;
System.Diagnostics.Process p = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = p.StartInfo;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(ErrorDataReceived);
p.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(SimulatorListDataReceived);
/// Get Device PIN
startInfo.FileName = "cmd.exe";
startInfo.Arguments = string.Format(@"/C " + bbndkPathConst + @"\eclipsec --list-all --simulator");
try
{
_simulatorList = new List<SimulatorsClass>();
p.Start();
p.BeginErrorReadLine();
p.BeginOutputReadLine();
p.WaitForExit();
if (p.ExitCode != 0)
{
success = false;
}
else
{
success = true;
}
p.Close();
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(startInfo.Arguments);
System.Diagnostics.Debug.WriteLine(e.Message);
success = false;
}
return success;
}