public override void ReceivedData(NSUrlConnection connection, NSData data) { if (result == null) { result = new byte[data.Length]; Marshal.Copy(data.Bytes, result, 0, (int)data.Length); } else if (written + (int)data.Length > result.Length) { byte[] nb = new byte [result.Length + (int)data.Length]; result.CopyTo(nb, 0); Marshal.Copy(data.Bytes, nb, result.Length, (int)data.Length); result = nb; } else { Marshal.Copy(data.Bytes, result, written, (int)data.Length); } written += (int)data.Length; if (nr.AbortRequested) { connection.Cancel(); return; } nr.TriggerUpdate(); }
public override NSUrlRequest WillSendRequest( NSUrlConnection connection, NSUrlRequest request, NSUrlResponse response) { NSMutableUrlRequest mutableRequest = (NSMutableUrlRequest)request.MutableCopy(); if (response != null) { RemoveProperty("ADURLProtocol", mutableRequest); _client.Redirected(_handler, mutableRequest, response); connection.Cancel(); if (!request.Headers.ContainsKey(new NSString("x-ms-PkeyAuth"))) { mutableRequest[BrokerConstants.ChallengeHeaderKey] = BrokerConstants.ChallengeHeaderValue; } return(mutableRequest); } if (!request.Headers.ContainsKey(new NSString(BrokerConstants.ChallengeHeaderKey))) { mutableRequest[BrokerConstants.ChallengeHeaderKey] = BrokerConstants.ChallengeHeaderValue; } return(mutableRequest); }
private void ReceivedResponse(NSUrlConnection connection, NSUrlResponse response) { connection.Cancel(); if (_request != null) { _renderer.LoadRequest(_request); } }
public override void StopLoading() { if (connection != null) { connection.Cancel(); connection = null; } }
public void StartCancel() { using (var url = new NSUrl("http://www.google.com")) using (var r = new NSUrlRequest(url)) using (var d = new MyDelegate()) using (var c = new NSUrlConnection(r, d)) { c.Start(); c.Cancel(); } }
public void StartCancel() { using (var url = new NSUrl(NetworkResources.MicrosoftUrl)) using (var r = new NSUrlRequest(url)) using (var d = new MyDelegate()) using (var c = new NSUrlConnection(r, d)) { c.Start(); c.Cancel(); } }
public override void FailedWithError(NSUrlConnection connection, NSError error) { handler.Client.FailedWithError(handler, error); connection.Cancel(); }
public override void FinishedLoading(NSUrlConnection connection) { handler.Client.FinishedLoading(handler); connection.Cancel(); }
public override void FailedWithError(NSUrlConnection connection, NSError error) { _handler.Client.FailedWithError(_handler, error); connection.Cancel(); }
public override void FinishedLoading(NSUrlConnection connection) { _handler.Client.FinishedLoading(_handler); connection.Cancel(); }
/// <summary> /// Should be authed now, start up the webview request again /// </summary> public override void ReceivedResponse(NSUrlConnection connection, NSUrlResponse response) { _auth = true; _view.LoadRequest(connection.CurrentRequest); connection.Cancel(); }