现在的位置: 首页 > 综合 > 正文

CallBack EventHandler

2013年02月21日 ⁄ 综合 ⁄ 共 399字 ⁄ 字号 评论关闭

private void TestA(string a, EventHandler<EventArgs> callBack)
        {
            if (a == "q")
            {
                callBack(false, new EventArgs());
            }
            else
            {
                callBack(true, new EventArgs());
            }
        }

 

private void TestB()

{

TestA("q", (aa, bb) =>
            {
                bool result = (bool)aa;
                MessageBox.Show(result.ToString());
            });

}

抱歉!评论已关闭.