public ProjectSettingsDlg(ProjectSettingsViewModel model)
        {
            InitializeComponent();

            m_txtRecordingProjectName.MaxLength = model.Project.MaxProjectNameLength;

            for (int i = 0; i < m_cboBookMarker.Items.Count; i++)
            {
                var chapterAnnouncement = (ChapterAnnouncement)i;
                m_cboBookMarker.Items[i] = new ChapterAnnouncementItem(LocalizationManager.GetDynamicString(GlyssenInfo.kApplicationId,
                                                                                                            "DialogBoxes.ProjectSettingsDlg.ChapterAnnouncementTab.BookMarkerComboBox.Items." + chapterAnnouncement,
                                                                                                            m_cboBookMarker.Items[i].ToString()), chapterAnnouncement);
            }

            IReadOnlyList <BookScript> books = model.Project.IncludedBooks.Any() ? model.Project.IncludedBooks : model.Project.Books;

            if (books.All(book => string.IsNullOrEmpty(book.PageHeader)))
            {
                RemoveItemFromBookMarkerCombo(ChapterAnnouncement.PageHeader);
            }
            if (books.All(book => string.IsNullOrEmpty(book.MainTitle)))
            {
                RemoveItemFromBookMarkerCombo(ChapterAnnouncement.MainTitle1);
            }

            LocalizeItemDlg <TMXDocument> .StringsLocalized += HandleStringsLocalized;
            ProjectSettingsViewModel = model;
            HandleStringsLocalized();
        }
示例#2
0
        public ProjectSettingsDlg(ProjectSettingsViewModel model)
        {
            InitializeComponent();

            for (int i = 0; i < m_cboBookMarker.Items.Count; i++)
            {
                var chapterAnnouncement = (ChapterAnnouncement)i;
                m_cboBookMarker.Items[i] = new ChapterAnnouncementItem(LocalizationManager.GetDynamicString(GlyssenInfo.kApplicationId,
                                                                                                            "DialogBoxes.ProjectSettingsDlg.ChapterAnnouncementTab.BookMarkerComboBox.Items." + chapterAnnouncement,
                                                                                                            m_cboBookMarker.Items[i].ToString()), chapterAnnouncement);
            }
            if (model.Project.IncludedBooks.All(book => string.IsNullOrEmpty(book.PageHeader)))
            {
                RemoveItemFromBookMarkerCombo(ChapterAnnouncement.PageHeader);
            }
            if (model.Project.IncludedBooks.All(book => string.IsNullOrEmpty(book.MainTitle)))
            {
                RemoveItemFromBookMarkerCombo(ChapterAnnouncement.MainTitle1);
            }

            LocalizeItemDlg.StringsLocalized += HandleStringsLocalized;
            HandleStringsLocalized();
            LoadProjectDramatizationOptions();
            ProjectSettingsViewModel = model;
            UpdateQuotePageDisplay();
        }
示例#3
0
 public ProjectSettingsDlg(ProjectSettingsViewModel model)
 {
     InitializeComponent();
     ProjectSettingsViewModel = model;
     UpdateDisplay();
 }
        public BlockNavigatorViewModel(Project project, BlocksToDisplay mode, BookBlockIndices startingIndices, ProjectSettingsViewModel settingsViewModel = null)
        {
            m_project = project;
            m_project.QuoteParseCompleted += (s, e) =>
            {
                m_navigator = new BlockNavigator(m_project.IncludedBooks);
                ResetFilter(null);
            };

            m_navigator = new BlockNavigator(m_project.IncludedBooks);

            m_includedBooks = project.IncludedBooks.Select(b => b.BookId);
            Versification   = project.Versification;

            if (settingsViewModel != null)
            {
                m_fontFamily           = settingsViewModel.WsModel.CurrentDefaultFontName;
                m_baseFontSizeInPoints = (int)settingsViewModel.WsModel.CurrentDefaultFontSize;
                m_rightToLeftScript    = settingsViewModel.WsModel.CurrentRightToLeftScript;
            }
            else
            {
                m_fontFamily           = project.FontFamily;
                m_baseFontSizeInPoints = project.FontSizeInPoints;
                m_rightToLeftScript    = project.RightToLeftScript;
            }
            FontSizeUiAdjustment = project.FontSizeUiAdjustment;

            Mode = mode;

            if (startingIndices != null && !startingIndices.IsUndefined)
            {
                SetBlock(startingIndices);
                m_currentBlockIndex = m_relevantBlocks.IndexOf(startingIndices);
                if (m_currentBlockIndex < 0)
                {
                    m_temporarilyIncludedBlock = startingIndices;
                }
            }
        }
 public BlockNavigatorViewModel(Project project, BlocksToDisplay mode = BlocksToDisplay.AllScripture, ProjectSettingsViewModel settingsViewModel = null)
     : this(project, mode, null, settingsViewModel)
 {
 }
        public BlockNavigatorViewModel(Project project, BlocksToDisplay mode, BookBlockIndices startingIndices, ProjectSettingsViewModel settingsViewModel = null)
        {
            m_project = project;
            m_project.QuoteParseCompleted += HandleProjectQuoteParseCompleted;

            m_navigator = new BlockNavigator(m_project.IncludedBooks);

            m_includedBooks = project.IncludedBooks.Select(b => b.BookId);
            Versification   = project.Versification;

            if (settingsViewModel != null)
            {
                m_font = new FontProxy(settingsViewModel.WsModel.CurrentDefaultFontName,
                                       (int)settingsViewModel.WsModel.CurrentDefaultFontSize, settingsViewModel.WsModel.CurrentRightToLeftScript);
            }
            else
            {
                m_font = new FontProxy(project.FontFamily, project.FontSizeInPoints, project.RightToLeftScript);
            }
            CacheReferenceTextFonts(project.ReferenceText);

            FontSizeUiAdjustment = project.FontSizeUiAdjustment;

            Mode = mode;

            if (startingIndices != null && !startingIndices.IsUndefined)
            {
                SetBlock(startingIndices);
                m_currentBlockIndex = m_relevantBlocks.IndexOf(startingIndices);
                if (m_currentBlockIndex < 0)
                {
                    m_temporarilyIncludedBlock = startingIndices;
                }
            }
        }