Is it possible to add ToString methods to an array of delegates?? If so how?? here is the code I have written:
public delegate string Task();
public static void Main(string[] args)
{
ArrayList studentArray = new ArrayList();
Course italianCook = new ItalianCookCourse { Teacher = "Ben Hodd" };
Course seafoodCook = new SeafoodCookCourse { Teacher = "Harry Cotter"};
Course sewingCourse = new SewingCourse
{
Teacher = "Margaret Mair",
ChargePerStudent = scFee,
CostPerStudent = 100.00m,
};
Course creativeWrite = new CreativeWritCourse { Teacher = "Mary Smith };
Course businessWrite = new BusinessWritCourse { Teacher = "Mary Smith" };
Task[] tasks = new Task(italianCook.ToString, seafoodCook.ToString, sewingCourse.ToString);
The error message is "string Class.ToString()" - "Method name expected"
As the tostring method handle as a string, is it possible to add it to delagate??