Inheritance: IDisposable
Exemple #1
0
 /// <summary>
 /// Returns the text between the positions start and end. If end is -1, text is returned to the end of the document. 
 /// The text is 0 terminated, so you must supply a buffer that is at least 1 character longer than the number of characters 
 /// you wish to read. The return value is the length of the returned text not including the terminating 0.
 /// </summary>
 public string GetTextByRange(int start, int end, int bufCapacity)
 {
     using (var textRange = new Sci_TextRange(start, end, bufCapacity))
     {
         Call(SciMsg.SCI_GETTEXTRANGE, 0, textRange.NativePointer);
         //return textRange.lpstrText;
         return IsUnicode() ? StringUtils.AnsiToUnicode(textRange.lpstrText) : textRange.lpstrText;
     }
 }
Exemple #2
0
 public string GetRange(int selStart, int selEnd, int bufCapacity)
 {
     using (var textRange = new Sci_TextRange(selStart, selEnd, bufCapacity))
     {
         Call(SciMsg.SCI_GETTEXTRANGE, 0, textRange.NativePointer);
         return textRange.lpstrText;
     }
 }