private void _readNativeStruct() { if (_ptrSciTextRange != IntPtr.Zero) { _sciTextRange = (Sci_TextRange)Marshal.PtrToStructure(_ptrSciTextRange, typeof(Sci_TextRange)); } }
public static string GetCurrentFileText(int length = -1) { if (length == -1) { length = Win32.SendMessage(GetCurrentScintilla(), SciMsg.SCI_GETLENGTH, 0, 0).ToInt32(); } Sci_TextRange range = new Sci_TextRange(0, -1, length); Win32.SendMessage(GetCurrentScintilla(), SciMsg.SCI_GETTEXTRANGE, 0, range.NativePointer); return(range.lpstrTextUtf8); }