Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        private void DisplayInitialArchiveSummary(IDictionary <string, Tuple <IEnumerable <string>, string> > fileLists, ArchivingDlgViewModel model)
        {
            foreach (var message in model.AdditionalMessages)
            {
                model.DisplayMessage(message.Key + "\n", message.Value);
            }

            if (fileLists.Count > 1)
            {
                model.DisplayMessage(LocalizationManager.GetString("DialogBoxes.ArchivingDlg.PrearchivingStatusMsg1",
                                                                   "The following session and contributor files will be added to your archive."), ArchivingDlgViewModel.MessageType.Normal);
            }
            else
            {
                model.DisplayMessage(LocalizationManager.GetString("DialogBoxes.ArchivingDlg.NoContributorsForSessionMsg",
                                                                   "There are no contributors for this session."), ArchivingDlgViewModel.MessageType.Warning);

                model.DisplayMessage(LocalizationManager.GetString("DialogBoxes.ArchivingDlg.PrearchivingStatusMsg2",
                                                                   "The following session files will be added to your archive."), ArchivingDlgViewModel.MessageType.Progress);
            }

            var fmt = LocalizationManager.GetString("DialogBoxes.ArchivingDlg.ArchivingProgressMsg", "     {0}: {1}",
                                                    "The first parameter is 'Session' or 'Contributor'. The second parameter is the session or contributor name.");

            foreach (var kvp in fileLists)
            {
                var element = (kvp.Key.StartsWith("\n") ?
                               LocalizationManager.GetString("DialogBoxes.ArchivingDlg.ContributorElementName", "Contributor") :
                               LocalizationManager.GetString("DialogBoxes.ArchivingDlg.SessionElementName", "Session"));

                model.DisplayMessage(string.Format(fmt, element, (kvp.Key.StartsWith("\n") ? kvp.Key.Substring(1) : kvp.Key)),
                                     ArchivingDlgViewModel.MessageType.Progress);

                foreach (var file in kvp.Value.Item1)
                {
                    model.DisplayMessage(Path.GetFileName(file), ArchivingDlgViewModel.MessageType.Bullet);
                }
            }
        }