我从Windows窗体应用程序调用控制台应用程序.我想从控制台应用程序中获取一个字符串列表.这是我的简化代码......
[STAThread]
static List<string> Main(string[] args)
{
List<string> returnValues = new List<string>();
returnValues.Add("str_1");
returnValues.Add("str_2");
returnValues.Add("str_3");
return returnValues;
}
Run Code Online (Sandbox Code Playgroud) I want to hold objects of different types in the same collection, but am unable to solve the problem.
public class SetupStep
{
public ObservableCollection</*Picture- or ParameterContaienr*/> Containers {get; set;}
}
public class PictureContainer
{
public ObservableCollection<Picture> Content {get; set;}
}
public class ParameterContainer
{
public ObservableCollection<Parameter> Content {get; set;}
}
Run Code Online (Sandbox Code Playgroud)
I think that this would be solvable via interfaces and generics, but I have not found a working solution so far. In the end, the container collection is to …