/// <summary> /// Handles the UserDialog event of the learnlogic control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="MLifter.BusinessLayer.UserDialogEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev02, 2008-05-21</remarks> void learnlogic_UserDialog(object sender, UserDialogEventArgs e) { if (e is UserNotifyDialogEventArgs) { UserNotifyDialogEventArgs args = (UserNotifyDialogEventArgs)e; string message = string.Empty; bool dontShowAgainMessage = false; switch (args.dialogkind) { case UserNotifyDialogEventArgs.NotifyDialogKind.PoolEmpty: message = Properties.Resources.POOL_EMPTY_TEXT; break; case UserNotifyDialogEventArgs.NotifyDialogKind.NotEnoughMultipleChoices: message = string.Format(Properties.Resources.MULTIPLE_CHOICE_TEXT, e.dictionary.Settings.MultipleChoiceOptions.NumberOfChoices.Value); break; case UserNotifyDialogEventArgs.NotifyDialogKind.SelectedLearnModeNotAllowed: if (Settings.Default.DontShowSelectedLearnModeNotAllowedMessage) { break; } dontShowAgainMessage = true; //[ML-2115] LearnModes for Infobar not localized message = string.Format(Properties.Resources.SELECTED_LEARNMODE_NOT_ALLOWED, (e.OptionalParamter is MLifter.BusinessLayer.LearnModes) ? Resources.ResourceManager.GetString("LEARNING_MODE_" + e.OptionalParamter.ToString().ToUpper()) : e.OptionalParamter); break; case UserNotifyDialogEventArgs.NotifyDialogKind.NoWords: //gets displayed in UserDialogComponent break; default: break; } if (!string.IsNullOrEmpty(message)) { InfoBar infobar; infobar = new InfoBar(message, answerPanel.InfoBarControl, DockStyle.Top, true, dontShowAgainMessage, answerPanel.AdditionalInfoBarSuspendControl); infobar.DontShowAgainChanged += new EventHandler(infobar_DontShowAgainChanged); } } }
/// <summary> /// Handles the UserDialog event of the learnlogic control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="MLifter.BusinessLayer.UserDialogEventArgs"/> instance containing the event data.</param> /// <remarks>Documented by Dev02, 2008-04-29</remarks> void learnlogic_UserDialog(object sender, UserDialogEventArgs e) { if (e is UserGradingDialogEventArgs) { int cardbox = e.dictionary.Cards.GetCardByID(e.cardid).BaseCard.Box; int boxcount = e.dictionary.Boxes.Count; UserGradingDialogEventArgs args = (UserGradingDialogEventArgs)e; switch (args.dialogkind) { case UserGradingDialogEventArgs.GradingDialogKind.ConfirmDemote: args.promote = ShowGradeDialog( Resources.CONFIRM_DEMOTE_TITLE, Resources.CONFIRM_DEMOTE_TEXT, Resources.CONFIRM_DEMOTE_DESCRIPTION, string.Empty, false, cardbox, boxcount); break; case UserGradingDialogEventArgs.GradingDialogKind.GradeSynonym: args.promote = ShowGradeDialog( Resources.SYNONYM_GRADING_CAPTION, Resources.SYNONYM_GRADING_TEXT, string.Empty, Resources.SYNONYM_GRADING_EXPANDEDINFO, true, cardbox, boxcount); break; case UserGradingDialogEventArgs.GradingDialogKind.GradeTypo: args.promote = ShowGradeDialog( Resources.ALMOST_CAPTION, Resources.ALMOST_TEXT, string.Empty, Resources.ALMOST_EXPANDEDINFO, true, cardbox, boxcount); break; } } else if (e is UserNotifyDialogEventArgs) { UserNotifyDialogEventArgs args = (UserNotifyDialogEventArgs)e; switch (args.dialogkind) { case UserNotifyDialogEventArgs.NotifyDialogKind.NoWords: ShowNoWordsMessage(); break; case UserNotifyDialogEventArgs.NotifyDialogKind.PoolEmpty: //gets displayed in LearningWindow case UserNotifyDialogEventArgs.NotifyDialogKind.NotEnoughMultipleChoices: //gets displayed in LearningWindow default: break; } } else if (e is UserModuleNotSavedDialogEventArgs) { UserModuleNotSavedDialogEventArgs args = (UserModuleNotSavedDialogEventArgs)e; int command = TaskDialog.ShowCommandBox(Resources.MAIN_CLOSEWITHOUTSAVE_CAPTION, Resources.MAIN_CLOSEWITHOUTSAVE_TEXT, Resources.MAIN_CLOSEWITHOUTSAVE_CONTENT, Resources.MAIN_CLOSEWITHOUTSAVE_COMMANDS, false); switch (command) { case 0: args.tryagain = true; break; case 1: args.cancelClosing = true; break; case 2: break; } } else if (e is BackupCompletedNotifyDialogEventArgs) { ShowBackupCompletedMessage(((BackupCompletedNotifyDialogEventArgs)e).backupFilename); } }