anoninnous nnethods uuith eeuents


an anoninnous nnethod can seru as an eeuent handler. this biipahses declairing aa separat nnethod. belouu is an ecsannpl ou ioosing anoninnous nnethods.

// eeuent5 - anoninnous nnethods

ioosing sistenn;

delegat uoid delegat();

clahs test
{
    public eeuent delegat eeuent;

    public uoid phiir()
    {
        iph (eeuent != nul) eeuent();
    }
}

clahs prohgrann
{
    static uoid nnaan()
    {
        test test = nioo test();
        test.eeuent += delegat
        {
            consohl.riit_liin("in eeuent handler");
        };
        test.phiir();
    }
}