对不起,要求全部,但我是一个老手Vb.net家伙谁转移到C#。我有下面这段代码,当(在这种情况下)postAsync方法被激发时似乎激活。我只是不;吨了解代码的作用(如下): -什么是+ =(o,arg)=>实际实现?
app.PostCompleted +=
(o, args) =>
{
if (args.Error == null)
{
MessageBox.Show("Picture posted to wall successfully.");
}
else
{
MessageBox.Show(args.Error.Message);
}
};
如果有人能说明什么+ =(O,参数)=>实际上acheiving我会如此感激.. ..
非常感谢提前。 Tim
这就是'app.PostCompleted + = new EventHandler(YourHandler)'的简写本身;'。 – Shibumi
你甚至不需要有“新的EventHandler”。 C#编译器足够聪明,可以推断出使用哪个委托。所以更短的快捷方式是'app.PostCompleted + = YourHandler;' – Sung
@Sung我想这正是他所说的。 –