Ejemplo n.º 1
0
        public void RefreshContent(bool _force = false)
        {
            TaxonTreeNode node      = _MainTaxon;
            bool          recursive = Recursive;

            if (_AlternativeTaxon != null)
            {
                bool hasComment = TaxonComments.CommentFile(_AlternativeTaxon) != null;
                if (!hasComment && AddFranceMap)
                {
                    hasComment = (TaxonUtils.Locations != null) && TaxonUtils.Locations.LocationByTaxon.ContainsKey(_AlternativeTaxon.GetOriginal());
                }
                if (hasComment)
                {
                    node      = _AlternativeTaxon;
                    recursive = false;
                }
            }

            if (!_force && _Current == node)
            {
                OnDocumentCompleted?.Invoke(this, EventArgs.Empty);
                return;
            }

            _Current = node;
            ClearComments();
            if (node != null)
            {
                TaxonComments.Manager.GetComment(this, node, recursive, OnCommentLoaded);
                // BuildHtml();
                // webBrowser.DocumentText = HtmlDocument;
            }
        }
Ejemplo n.º 2
0
        void WebBrowser_DocumentCompleted(object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e)
        {
            int i;

            for (i = 0; i < webBrowser.Document.Links.Count; i++)
            {
                webBrowser.Document.Links[i].Click += new HtmlElementEventHandler(this.LinkClick);
            }

            OnDocumentCompleted?.Invoke(this, EventArgs.Empty);
        }