public void Run() { TGenericDelegate <string> del = ADelegate <string>; TestMethod <string> ("a param", ADelegate <string>); TestMethod <string> ("another param", del); }
private void TestMethod <T> (string param, TGenericDelegate <T> del) { Console.WriteLine("TestMethod <T> called with param: {0}. Calling a delegate", param); if (del != null) { del(param); } }