public delegate void d_ReadyToPrint(byte[] bytes);
public event d_ReadyToPrint ReadyToPrint;
public void ClearAllEvent()
{
if (ReadyToPrint == null) return;
Delegate[] dels = ReadyToPrint.GetInvocationList();
foreach (Delegate del in dels)
{
object delObj = del.GetType().GetProperty("Method").GetValue(del, null);
string funcName = (string)delObj.GetType().GetProperty("Name").GetValue(delObj, null);
Console.WriteLine(funcName);
ReadyToPrint -= del as d_ReadyToPrint;
}
}