Call functions in an event/function chain?

Posted by acidzombie24 on Stack Overflow See other posts from Stack Overflow or by acidzombie24
Published on 2010-04-10T15:11:07Z Indexed on 2010/04/10 15:13 UTC
Read the original article Hit count: 167

Filed under:

I have 3 functions. They can be called in any order (later they may need specific order). The return value of one function should be the first param of the next. How do i do this? what i am thinking is something like the below. Whats the best way to do this?

string void fn(string sz, data d, eventhdl nextFunc)
{
    //do stuff
    if(nextFunc == null)
        return ret;
    else
        return nextFunc(ret, d, nextFunc.Next);
}

© Stack Overflow or respective owner

Related posts about c#