Example #1
0
        void MembersList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (membersList.SelectedItem != null)
            {
                var info = (membersList.SelectedItem as MemberInfo);
                try
                {
                    membersList.SelectedItem = null;
                    if (info.Line != -1)
                    {
                        Npp.GrabFocus();
                        int currentLineNum  = Npp.GetCaretLineNumber();
                        int prevLineEnd     = Npp.GetLineStart(currentLineNum) - Environment.NewLine.Length;
                        int topScrollOffset = currentLineNum - Npp.GetFirstVisibleLine();

                        Win32.SendMessage(Npp.CurrentScintilla, SciMsg.SCI_GOTOLINE, info.Line, 0);
                        Npp.SetFirstVisibleLine(info.Line - topScrollOffset);
                    }
                }
                catch { } //it is expected to fail if the line does not contain the file content position spec. This is also the reason for not validating any "IndexOf" results.
            }
        }