public int Main()
{

    Func<InParameter, OutParameter>[] createGroupAction = 
    {
        CreateGroup1, 
        CreateGroup2, 
        CreateGroup3, 
        CreateGroup4 
    };

    for (int f = 0; f < createGroupAction.GetLength(0); f++) {

        var outParameter = createGroupAction[f](inParameter);
    }

    return 0;

}

private OutParameter CreateGroup1(InParameter parameter)
{
    return new OutParameter(parameter);
}

 

參考資料:

http://stackoverflow.com/questions/10867574/c-sharp-how-to-save-a-function-call-for-in-memory-for-later-invoking

arrow
arrow
    全站熱搜

    小賢 發表在 痞客邦 留言(0) 人氣()