using System;using System.Collections.Generic;using System.Text;namespace Delegate{ public class DelegateTest { protected delegate void MyDelegate(); private void TestMethod() { } private void Method() { MyDelegate aMyDelegate = new MyDelegate(TestMethod); Method(aMyDelegate); } private void Method(MyDelegate aMyDelegate) { if (aMyDelegate != null) { aMyDelegate(); } } }}
public delegate void MyDelegate();