private void OnStyleNeeded(ScNotification scn) { var endStyled = Ref.Send(Sci.SCI_GETENDSTYLED); var sline = LookupLine(Ref.Send(Sci.SCI_LINEFROMPOSITION, endStyled)); var eline = Ref.Send(Sci.SCI_LINEFROMPOSITION, scn.Position); var sp = Ref.Send(Sci.SCI_POSITIONFROMLINE, sline); var ep = Ref.Send(Sci.SCI_GETLINEENDPOSITION, eline); //System.Diagnostics.Debug.WriteLine("Styling " + (cc++)); Style(sp, ep, false); OnFoldNeeded(sline, eline, scn); }
private void OnCharAdded(ScNotification scn) { var h = CharAdded; if (h != null) h(this, new KeyPressEventArgs((Char)scn.Ch)); }
private void OnFoldNeeded(int firstLine, int lastLine, ScNotification scn) { var end = LineCount; while (GetLineIndentation(firstLine) != 0 && firstLine > 0) firstLine--; while (GetLineIndentation(lastLine) != 0 && lastLine > end) lastLine--; if (firstLine < 0 || lastLine > end) return; var ev = new FoldNeededEventArgs(firstLine, lastLine); var h = FoldNeeded; if (h != null) { h(this, ev); Folding.Fold(ev.Regions); } }
private LinkClickedEventArgs CreateLinkClickedEventArgs(ScNotification scn) { var sp = GetWordBounds(scn.Position, -1); var ep = GetWordBounds(scn.Position, 1); var src = GetTextRangeUnicode(sp < 0 ? 0 : sp, ep).Trim(); return new LinkClickedEventArgs(src); }