public HttpSample ( bool secure ) : System.Threading.Tasks.Task | ||
secure | bool | |
Résultat | System.Threading.Tasks.Task |
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button> (Resource.Id.button); Button button1 = FindViewById <Button> (Resource.Id.button1); EditText output = FindViewById <EditText> (Resource.Id.Output); button.Click += async delegate { var r = new Renderer(this, output); var nh = new NetHttp(r); await nh.HttpSample(WisdomUrl); }; button1.Click += async delegate { var r = new Renderer(this, output); var nh = new NetHttp(r); await nh.HttpSample(SecureUrl); }; }
async void Button1TouchDown(object sender, EventArgs e) { var r = new Renderer(this); // Do not queue more than one request if (UIApplication.SharedApplication.NetworkActivityIndicatorVisible) { return; } switch (stack.SelectedRow()) { case 0: new DotNet(r).HttpSample("https://gmail.com"); break; case 1: new DotNet(r).HttpSecureSample(Application.WisdomUrl); break; case 2: var nh = new NetHttp(r); await nh.HttpSample(Application.WisdomUrl); break; case 3: var nhs = new NetHttp(r); await nhs.HttpSample(Application.SecureUrl); break; //case 3: // // new Cocoa (this).HttpSample (); // break; } }