简体   繁体   English

Monodroid / Android-相当于NSAction

[英]Monodroid/Android - Equivalent of NSAction

I am using monodroid and I am converting an iPhone application to android, and in the code I came across this which is only meant for iPhones 我正在使用monodroid,并将iPhone应用程序转换为android,在代码中,我碰到了这仅适用于iPhone

public void method(NSAction successCallback)
    {
...
}

what is the equivalent of NSAction for android/C#? NSAction对于android / C#等效于什么?

Maybe you could use an [Action<T>][1] or perhaps a delegate? 也许您可以使用[Action<T>][1]或委托? These are more of a C# thing than an Android or iOS thing, but otherwise there really isn't anything. 这些比起Android或iOS而言,更多的是C#的东西,但除此之外,实际上没有任何东西。

Another thought would be to raise an event instead of having method(NSAction successCallback) invoke the callback. 另一个想法是引发一个事件,而不是让method(NSAction successCallback)调用回调。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM