Пример #1
0
        public override void InitPane(ViewsManager views, View ownerView, SplitterPanel panel, RibbonTab tab)
        {
            base.InitPane(views, ownerView, panel, tab);

            _views.MainForm.sourceDocuments.CurrentChanged += OnCurrentDocumentChanged;

            var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly()
                                             .Location);

            path = Path.Combine(path, "HtmlViewer");
            CefSharpSettings.LegacyJavascriptBindingEnabled = true;
            if (_viewType == DocumentViewType.Html_ListView)
            {
                _browser = new ChromiumWebBrowser(Path.Combine(path, "listview.html"));

                _browser.RegisterAsyncJsObject("boundAsync", new AsyncBoundListObject(this));
            }
            else if (_viewType == DocumentViewType.Html_CalenderView)
            {
                _browser = new ChromiumWebBrowser(Path.Combine(path, "calenderview.html"));

                _browser.RegisterAsyncJsObject("boundAsync", new AsyncBoundCalenderObject(this));
            }
            else if (_viewType == DocumentViewType.Html_MedaCyEntityView)
            {
                _browser = new ChromiumWebBrowser(Path.Combine(path, "entities.html"));
                _browser.RegisterAsyncJsObject("boundAsync", new AsyncBoundEntitiesObject(this));
            }
            else if (_viewType == DocumentViewType.Html_SpaCyEntityView)
            {
                _browser = new ChromiumWebBrowser(Path.Combine(path, "spacy_entities.html"));
                _browser.RegisterAsyncJsObject("boundAsync", new AsyncBoundSpacyEntitiesObject(this));
            }

            _browser.Dock = DockStyle.Fill;

            {
                if (ownerView.Name == "Columns RegEx")
                {
                    _paneColumnNotes = new PaneColumnNotes(NoteColumnName);

                    _paneColumnNotes.InitPane(views, ownerView, panel, tab);
                    _paneColumnNotes._eventDataModified += new EventHandler(OnDataModified);

                    _paneColumnNotes.ShowToolbar = false;

                    _paneColumnNotes.Dock = DockStyle.Fill;
                    _paneColumnNotes.ShowPane();

                    this.paneSplitter.Panel1.Controls.Add(_paneColumnNotes);
                }
                else if (ownerView.Name == "Default" || ownerView.Name == "ReviewML")
                {
                    _paneNotes = new PaneNotes(NoteColumnName);


                    _paneNotes.InitPane(views, ownerView, panel, tab);
                    _paneNotes._eventDataModified += new EventHandler(OnDataModified);

                    _paneNotes.ShowToolbar = false;

                    _paneNotes.Dock = DockStyle.Fill;
                    _paneNotes.ShowPane();

                    this.paneSplitter.Panel1.Controls.Add(_paneNotes);
                }

                this.paneSplitter.Panel1Collapsed = true;
                this.paneSplitter.Panel1.Hide();
            }

            this.paneSplitter.Panel2.Controls.Add(_browser);
        }
Пример #2
0
        public TabPage AddNewTab(TabSetting tabSetting)
        {
            TabPage tabPage = new TabPage();

            tabPage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(255)))));
            tabPage.Location  = new System.Drawing.Point(4, 25);
            tabPage.Margin    = new System.Windows.Forms.Padding(0);
            tabPage.Name      = tabSetting.ColumnName;
            tabPage.Size      = new System.Drawing.Size(940, 820);
            //tabPage.TabIndex = tabSetting.Index;

            tabPage.Text = tabSetting.DisplayName;

            tabPage.Tag = tabSetting;

            if (tabSetting.TabType == DocumentViewType.Normal)
            {
                PaneColumnNotes paneNotes = new PaneColumnNotes(tabSetting.ColumnName);

                paneNotes.InitPane(_views, _ownerView, _panel, _tab);
                paneNotes._eventDataModified += new EventHandler(OnDataModified);
                paneNotes.CalcScores         += new EventHandler(paneTabs_CalcScores);
                paneNotes.RefreshHighlights  += new EventHandler(paneTabs_RefreshHighlights);

                paneNotes.SortTabs      += new EventHandler(onTabs_Clicked);
                paneNotes.AddBrowserTab += new EventHandler(onAddBrowserTab_Clicked);
                paneNotes.AddViewTab    += new EventHandler(onAddViewTab_Clicked);

                //_splitter.Panel2.Controls.Add(_paneNotes);
                paneNotes.ShowPane();

                //_paneNotesList.Add(paneNotes);

                tabPage.Controls.Add(paneNotes);
            }
            else if (tabSetting.TabType == DocumentViewType.Browser)
            {
                PaneBrowser paneBrowser = new PaneBrowser(tabSetting.ColumnName);
                paneBrowser.InitPane(_views, _ownerView, _panel, _tab);

                paneBrowser.SortTabs      += new EventHandler(this.onTabs_Clicked);
                paneBrowser.AddBrowserTab += new EventHandler(this.onAddBrowserTab_Clicked);
                paneBrowser.AddViewTab    += new EventHandler(this.onAddViewTab_Clicked);

                paneBrowser.ShowPane();

                tabPage.Controls.Add(paneBrowser);
            }
            else
            {
                PaneNoteHtmlView paneHtmlView = new PaneNoteHtmlView(tabSetting.ColumnName, tabSetting.TabType);

                paneHtmlView.InitPane(_views, _ownerView, _panel, _tab);
                paneHtmlView._eventDataModified += new EventHandler(OnDataModified);


                paneHtmlView.SortTabs      += new EventHandler(onTabs_Clicked);
                paneHtmlView.AddBrowserTab += new EventHandler(onAddBrowserTab_Clicked);
                paneHtmlView.AddViewTab    += new EventHandler(onAddViewTab_Clicked);

                //_splitter.Panel2.Controls.Add(_paneNotes);
                paneHtmlView.ShowPane();

                //_extraPaneNotesList.Add(paneHtmlView.GetDebugPaneColumnNotes());

                tabPage.Controls.Add(paneHtmlView);
            }
            return(tabPage);
        }