AutoWikiBrowser.AWBWebBrowser.TextSelectedChecked C# (CSharp) Method

TextSelectedChecked() private method

Returns whether there is currently any text selected Only works if Microsoft.mshtml.dll is available
private TextSelectedChecked ( ) : bool
return bool
        private bool TextSelectedChecked()
        {
            IHTMLDocument2 htmlDocument = Document.DomDocument as IHTMLDocument2;

            IHTMLSelectionObject currentSelection = htmlDocument.selection;

            if (currentSelection != null)
            {
                IHTMLTxtRange range = currentSelection.createRange() as IHTMLTxtRange;

                if (range != null && !string.IsNullOrEmpty(range.text))
                    return true;
            }

            return false;
        }