Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# void equivalent for template parameters

The context of my question is that I'm using MonoDroid to write a program to consume WCF services. I wanted some of the C# libraries regarding SOAP in C# so MonoDroid was an obvious choice.

I am stuck trying to pass void as template parameter to AsyncTask.

The documentation that Xamarin (developers of MonoDroid) gives on AsyncTask leaves much to be desired and can be found here : http://docs.mono-android.net/?link=C%3aAndroid.OS.AsyncTask

What I need to do, I accomplished in Java with an AsyncTask defined like this

        public class SoapRequestTask extends AsyncTask<Void, Void, String>

What is the C# equivalent of a void template parameter?

like image 981
SmashCode Avatar asked Mar 31 '26 17:03

SmashCode


1 Answers

I actually found the answer to this for anyone who is interested:

The syntax is

    private class SoapTask : AsyncTask{}

And it works just like AsyncTask in java, but the parameters are all Java.Lang.Objects (with the exception that the parameters type is a Java.Lang.Objects[] ) so you can just set them as needed in the body.

like image 149
SmashCode Avatar answered Apr 03 '26 06:04

SmashCode



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!