I have a folder named "Features" in the solution. This folder can have for example 500 .cs files with classes i them.
In the below example I manually put 2 of those 500 classes in a List:
Features.testclass.cs
Features.testclass2.cs
I wonder how it would be possible to programatically collect ALL classes in those 500.cs files in the Features folder and add them to the list like I do below manually as an example?
Notice that I am saving a new instance of each class in the List as I need to call those classes later on
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public interface IFace { String GetValue(); }
void GetClasses()
{
var MyList = new List<IFace>();
MyList.Add(new Features.testclass());
MyList.Add(new Features.testclass2());
}
}
}