private void ContactListCompleted(Object sender, krw.ContactListCompletedEventArgs Completed) { try { DataTable result = Completed.Result; using (frmContactList frm = new frmContactList()) { frm.cList = result; frm.ShowDialog(this); if (frm.hasChanged) { cList = frm.cList; SendRequest("ContactListCatchChanges"); } else Base.Loading(this, false); } } catch (SoapException ex) { TryRequest("ContactList", ex.Message + "\n\n" + ex.InnerException.Message); } catch (Exception ex) { TryRequest("ContactList", ex.Message + "\n\n" + ex.InnerException.Message); } finally { } }
private void TryRequest(string req, string err) { StringBuilder sb = new StringBuilder(); sb.Append(Base.errServer); sb.Append("\n\n\n"); sb.Append(err); DialogResult result = MessageBox.Show(sb.ToString(), Base.errServerHeader, MessageBoxButtons.RetryCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign); switch (result) { case DialogResult.Retry: SendRequest(req); break; case DialogResult.Cancel: if (req == "ContactListCatchChanges") { using (frmContactList frm = new frmContactList()) { frm.cList = cList; cList = new DataTable(); frm.retryMode = true; frm.ShowDialog(this); if (frm.hasChanged) { cList = frm.cList; SendRequest("ContactListCatchChanges"); } else Base.Loading(this, false); } return; } Base.Loading(this, false); break; default: break; } }