partial void BtnDesactivateDAuth_TouchUpInside(UIButton sender) { MessageBox.ShowYesNo("Double Authentification", "Êtes vous sûr de vouloir supprimer la double authentification?", delegate { ServerPacketConfirmation serverPacketConfirmation = ServerHelper.DisableUserDAuth(Application.ActualUser); //if success if (serverPacketConfirmation.ActionSuccess) { MessageBox.ShowOK("Double authentification", "La double authentification a bien été désactivée.", this, delegate { Application.ActualUserPrivateKey = null; this.NavigationController.PopToRootViewController(true); }); } else { //get the good error message String errorMessage = string.Empty; switch (serverPacketConfirmation.NetworkError) { case NetworkError.SERVER_UNAVAILABLE: errorMessage = MSGBank.ERROR_NO_SERVER; break; default: errorMessage = $"Impossible de désactiver la double authentification."; break; } BarHelper.DisplayErrorBar(uivMainView, MSGBank.ERROR_TITLE, errorMessage); } }, delegate { //no action }, this); }