/// <summary> /// Given a document position which is filled with this indicator, will return the document position /// where the use of this indicator ends. /// </summary> /// <param name="position">A zero-based document position using this indicator.</param> /// <returns>The zero-based document position where the use of this indicator ends.</returns> /// <remarks> /// Specifying a <paramref name="position" /> which is not filled with this indicator will cause this method /// to return the end position of the range where this indicator is not in use (the negative space). If this /// indicator is not in use anywhere within the document the return value will be 0. /// </remarks> public int End(int position) { position = Helpers.Clamp(position, 0, Scintilla.TextLength); position = Scintilla.Lines.CharToBytePosition(position); position = Scintilla.DirectMessage(NativeMethods.SCI_INDICATOREND, new IntPtr(Index), new IntPtr(position)).ToInt32(); return(Scintilla.Lines.ByteToCharPosition(position)); }
/// <summary> /// Sets the marker symbol to a custom image. /// </summary> /// <param name="image">The Bitmap to use as a marker symbol.</param> /// <remarks>Calling this method will also update the <see cref="Symbol" /> property to <see cref="MarkerSymbol.RgbaImage" />.</remarks> public unsafe void DefineRgbaImage(Bitmap image) { if (image == null) { return; } Scintilla.DirectMessage(NativeMethods.SCI_RGBAIMAGESETWIDTH, new IntPtr(image.Width)); Scintilla.DirectMessage(NativeMethods.SCI_RGBAIMAGESETHEIGHT, new IntPtr(image.Height)); var bytes = Helpers.BitmapToArgb(image); fixed(byte *bp = bytes) Scintilla.DirectMessage(NativeMethods.SCI_MARKERDEFINERGBAIMAGE, new IntPtr(Index), new IntPtr(bp)); }
/// <summary> /// Expands any parent folds to ensure the line is visible. /// </summary> public void EnsureVisible() { Scintilla.DirectMessage(NativeMethods.SCI_ENSUREVISIBLE, new IntPtr(Index)); }
/// <summary> /// Removes all text displayed in every <see cref="MarginType.Text" /> and <see cref="MarginType.RightText" /> margins. /// </summary> public void ClearAllText() { Scintilla.DirectMessage(NativeMethods.SCI_MARGINTEXTCLEARALL); }