示例#1
0
        private void Replace_Menu_Click(object sender, EventArgs e)
        {
            if (CurrentTab != null)
            {
                string findText = "";

                NTDLS.Windows.Forms.CodeEditor.Selection selection = CurrentTab.CodeEditor.Selection;
                if (selection != null && selection.Text.Length > 0)
                {
                    findText = selection.Text;
                }
                else
                {
                    int caretX = CurrentTab.CodeEditor.Caret.Position.X;
                    int caretY = CurrentTab.CodeEditor.Caret.Position.Y;
                    if (caretX >= 0 && caretY >= 0)
                    {
                        NTDLS.Syntax.TextPoint currentWordPos = new NTDLS.Syntax.TextPoint(caretX, caretY);
                        NTDLS.Syntax.Word      currentWord    = CurrentTab.CodeEditor.Document.GetValidWordFromPos(currentWordPos);
                        if (currentWord != null && currentWord.Text.Length > 0)
                        {
                            findText = currentWord.Text.Trim();
                            if (findText.Substring(findText.Length - 1) == ",")
                            {
                                findText = findText.Substring(0, findText.Length - 1);
                            }
                        }
                    }
                }

                CurrentTab.CodeEditor.ShowReplace(findText);
            }
        }
示例#2
0
        private void Contents_Menu_Click(object sender, EventArgs e)
        {
            string helpPath = global.GetRegistryString("", "Path", null);

            if (helpPath != null)
            {
                string sDocumentation = helpPath + "\\Help\\Help.chm";

                if (_HelpViewer == null || _HelpViewer.Visible == false)
                {
                    _HelpViewer = new HtmlHelpViewer.Viewer();

                    _HelpViewer.Show();
                    if (!_HelpViewer.OpenFile(sDocumentation))
                    {
                        _HelpViewer.Close();
                    }
                }
                else
                {
                    _HelpViewer.Focus();
                }
                if (CurrentTab != null)
                {
                    NTDLS.Windows.Forms.CodeEditor.Selection selection = CurrentTab.CodeEditor.Selection;
                    if (selection != null && selection.Text.Length > 0)
                    {
                        //_HelpViewer.IndexSelect(selection.Text.Trim());
                        _HelpViewer.SearchForText(selection.Text.Trim().Replace(".", " "));
                    }
                }
            }
        }