Example #1
0
 private void FTextArea_HelpRequested(object sender, HelpEventArgs args)
 {
     if (_textEdit.ActiveTextAreaControl.SelectionManager.HasSomethingSelected)
     {
         Dataphoria.InvokeHelp(_textEdit.ActiveTextAreaControl.SelectionManager.SelectedText);
     }
     else
     {
         string word = "";
         // the next 7 lines added/modified to overcome bug in FindWordStart
         // runtime error if Caret is at end of document
         int caretOffset = _textEdit.ActiveTextAreaControl.Caret.Offset;
         int textLength  = _textEdit.Document.TextLength;
         if (textLength > 0)
         {
             if (caretOffset == textLength)
             {
                 caretOffset--;
             }
             int first = TextEdit.FindWordStart(_textEdit.Document, caretOffset);
             int last  = TextEdit.FindWordEnd(_textEdit.Document, caretOffset);
             word = _textEdit.Document.GetText(first, last - first);
         }
         if (word.Trim().Length == 0)
         {
             Dataphoria.InvokeHelp(DesignerID);
         }
         else
         {
             Dataphoria.InvokeHelp(word);
         }
     }
 }
Example #2
0
 protected override void OnHelpRequested(HelpEventArgs args)
 {
     base.OnHelpRequested(args);
     Dataphoria.InvokeHelp("Analyzer");
 }