private void ClientOnGetCustomerCompleted(object sender, GetCustomersExCompletedEventArgs e) { List <Customer> list = new List <Customer> (); string msg = null; bool success = true; if (e.Error != null) { msg = e.Error.Message; success = false; } else if (e.Cancelled) { msg = CallingActivity.Resources.GetString(Resource.String.msg_reqcancel); success = false; } else { list = e.Result.ToList <Customer>(); RunOnUiThread(() => InsertCustomerIntoDb(list)); } if (!success) { RunOnUiThread(() => Downloadhandle.Invoke(CallingActivity, 0, msg)); if (_downloadAll) { _downloadAll = false; FireEvent(EventID.LOGIN_DOWNCOMPLETE); } } }
private void ClientOnGetCustomerCompleted(object sender, GetCustomersExCompletedEventArgs e) { List<Customer> list = new List<Customer> (); string msg = null; bool success = true; if ( e.Error != null) { msg = e.Error.Message; success = false; } else if ( e.Cancelled) { msg = "Request was cancelled."; success = false; } else { list = e.Result.ToList<Customer>(); RunOnUiThread (() => InsertCustomerIntoDb (list)); } if (!success) { RunOnUiThread (() => Downloadhandle.Invoke(CallingActivity,0,msg)); if (_downloadAll) { _downloadAll = false; FireEvent (EventID.LOGIN_DOWNCOMPLETE); } } }