Ejemplo n.º 1
0
        public static ascx_SourceCodeEditor showHtmlNodeLocation(this ascx_SourceCodeEditor codeEditor, HtmlAgilityPack.HtmlNode htmlNode)
        {
            var startLine   = htmlNode.Line;
            var startColumn = htmlNode.LinePosition;

            var endLine   = startLine;
            var endColumn = startColumn;

            if (htmlNode.NextSibling != null)
            {
                endLine   = htmlNode.NextSibling.Line;
                endColumn = htmlNode.NextSibling.LinePosition;
            }
            else
            {
                endColumn += htmlNode.html().size();
            }
            "selecting CodeEditor location: {0}:{1} -> {2}:{3}".info(startLine, startColumn, endLine, endColumn);
            codeEditor.clearMarkers();
            codeEditor.selectTextWithColor(startLine, startColumn, endLine, endColumn);
            codeEditor.caret_Line(startLine);
            codeEditor.refresh();

            return(codeEditor);
        }