/// <summary> /// Methode à exécuter lors du clic sur la commande Accueil /// </summary> public async void ExecuteModifier() { try{ // Create the message dialog and set its content and title var messageDialog = new MessageDialog("Êtes-vous certain de vouloir modifier le calendrier selectionné ?", "Demande de confirmation"); // Add commands and set their command ids messageDialog.Commands.Add(new UICommand("Annuler", null, 0)); messageDialog.Commands.Add(new UICommand("Confirmer", null, 1)); // Set the command that will be invoked by default messageDialog.DefaultCommandIndex = 0; // Show the message dialog and get the event that was invoked via the async operator var commandChosen = await messageDialog.ShowAsync(); if (commandChosen.Label.Equals("Confirmer")) { CalendarControler controler = new CalendarControler(); await controler.UpdateCalendar(cal.Calendar); //on met à jour la liste des calendriers parent.MajCalendar(cal.Calendar); } } catch (HttpRequestException e) { var messageDialog = new MessageDialog(e.Message+"Impossible de modifier le calendrier. Vous n'êtes plus connecté à votre compte.", "Suppression impossible"); messageDialog.ShowAsync(); } }
/// <summary> /// Methode à exécuter lors du clic sur la commande Accueil /// </summary> public async void ExecuteModifier() { try { // Create the message dialog and set its content and title var messageDialog = new MessageDialog(IConstantes.MSG_CONFIRM_UPDATE_CAL); // Add commands and set their command ids messageDialog.Commands.Add(new UICommand(IConstantes.BUTTON_CANCEL, null, 0)); messageDialog.Commands.Add(new UICommand(IConstantes.BUTTON_CONFIRM, null, 1)); // Set the command that will be invoked by default messageDialog.DefaultCommandIndex = 0; // Show the message dialog and get the event that was invoked via the async operator var commandChosen = await messageDialog.ShowAsync(); if (commandChosen.Label.Equals(IConstantes.BUTTON_CONFIRM)) { CalendarControler controler = new CalendarControler(); await controler.UpdateCalendar(cal.Calendar); //on met à jour la liste des calendriers parent.MajCalendar(cal.Calendar); } } catch (HttpRequestException e) { var messageDialog = new MessageDialog(e.Message + IConstantes.EXCEPTION_MSG_UPDATE); messageDialog.ShowAsync(); } }