Example #1
0
        public void ChooseNewLibrary(WebLibraryDetail picked_web_library_detail)
        {
            web_library_detail            = picked_web_library_detail;
            TextLibraryForExpedition.Text = "Click to choose a library.";
            ObjTopicListPanel.Children.Clear();

            ObjExpeditionInstructionsControl.ReflectLibrary(web_library_detail);

            if (null != web_library_detail)
            {
                TextLibraryForExpedition.Text = web_library_detail.Title;

                int suggested_theme_count = web_library_detail.Xlibrary?.ExpeditionManager?.RecommendedThemeCount ?? 0;
                TextExpeditionNumThemes.Text    = $"{suggested_theme_count}";
                TextExpeditionNumThemes.ToolTip = $"How many themes do you want in this Expedition?\n({ suggested_theme_count } suggested)";

                ExpeditionDataSource eds = web_library_detail.Xlibrary?.ExpeditionManager?.ExpeditionDataSource;

                if (null != eds)
                {
                    for (int i = 0; i < eds.LDAAnalysis.NUM_TOPICS; ++i)
                    {
                        TopicOverviewControl.TopicOverviewData tod = new TopicOverviewControl.TopicOverviewData
                        {
                            web_library_detail = web_library_detail,
                            topic = i,
                        };

                        TopicOverviewControl toc = new TopicOverviewControl();
                        toc.PDFDocumentSelected += toc_PDFDocumentSelected;
                        toc.DataContext          = tod;

                        ObjTopicListPanel.Children.Add(toc);
                    }
                }
            }
        }
        public void ChooseNewLibrary(WebLibraryDetail web_library_detail)
        {
            this.library = null;
            TextLibraryForExpedition.Text = "Click to choose a library.";
            ObjTopicListPanel.Children.Clear();

            ObjExpeditionInstructionsControl.ReflectLibrary(web_library_detail);

            if (null != web_library_detail)
            {
                this.library = web_library_detail.library;
                TextLibraryForExpedition.Text = web_library_detail.Title;

                int suggested_theme_count = this.library.ExpeditionManager.RecommendedThemeCount;
                TextExpeditionNumThemes.Text = "" + suggested_theme_count;
                TextExpeditionNumThemes.ToolTip = "How many themes do you want in this Expedition?\n(" + suggested_theme_count + " suggested)";

                if (null != library.ExpeditionManager.ExpeditionDataSource)
                {
                    for (int i = 0; i < library.ExpeditionManager.ExpeditionDataSource.LDAAnalysis.NUM_TOPICS; ++i)
                    {
                        TopicOverviewControl.TopicOverviewData tod = new TopicOverviewControl.TopicOverviewData
                        {
                            library = library,
                            topic = i,
                        };

                        TopicOverviewControl toc = new TopicOverviewControl();
                        toc.PDFDocumentSelected += toc_PDFDocumentSelected;
                        toc.DataContext = tod;

                        ObjTopicListPanel.Children.Add(toc);
                    }
                }
            }
        }