I have a Click function that starts up a program with the selected arguments
private void Launch_Click(object sender, RoutedEventArgs e)
{
//start up proccess here
Process.StartInfo.Arguments = app + app_output + nosplash + showscripterrors;
etc...
}
works fine but for the string app_output is a foreach statement using the code below. The problem is that only the last foreach item is being set in the argument. I basically want the app_string to be itemA;itemB;itemC etc...
string app_string = "0";
string app_output = "0";
foreach (var item in TheList)
{
//item.PropertyChanged += TheList_Item_PropertyChanged;
if (item.IsSelected == true)
{
app_string = item.TheText;
app_output = app_string + ";";
}
else
{
//System.Windows.MessageBox.Show("no item selected");
}
}
how would i go about getting the app_output to render the foreach items? Shout i enter the foreach into an array?
Ive tried placing the foreach code within the argument string but does not allow foreach method inside it.