ITextBuffer

References
public interface ITextBuffer
Interface for a formatted text buffer

Properties

SupportedFormats

#
IEnumerable<RichTextAreaFormat> SupportedFormats { get; }
Gets an enumeration of formats supported for the Load(Stream, RichTextAreaFormat) and Save(Stream, RichTextAreaFormat) methods.

Methods

Delete

#
void Delete(Range<int> range)
Deletes text from the specified range

Insert

#
void Insert(int position, string text)
Inserts text with the format of the text at the specified position.

Load

#
void Load(Stream stream, RichTextAreaFormat format)
Loads the specified format from the stream, replacing the content of the buffer.
Remarks: The CaretIndex and Selection will be set to the end of the string after set.
stream (Stream)Stream to load from.
format (RichTextAreaFormat)Format of the stream to load.

Save

#
void Save(Stream stream, RichTextAreaFormat format)
Saves the buffer into a stream with the specified format.

SetBackground

#
void SetBackground(Range<int> range, Color color)
Sets the background color for the specified range.
range (Range<int>)Range to set the background color.
color (Color)Color to set the text background in the range.

SetBold

#
void SetBold(Range<int> range, bool bold)
Sets the bold flag for the specified text range.
range (Range<int>)Range to set the font weight.
bold (bool)If set to true, then text will be bold.

SetFamily

#
void SetFamily(Range<int> range, FontFamily family)
Sets the font family for the specified text range.
range (Range<int>)Range to set the font family.
family (FontFamily)Font family for the text in the range.

SetFont

#
void SetFont(Range<int> range, Font font)
Sets the font for the specified text range.

SetForeground

#
void SetForeground(Range<int> range, Color color)
Sets the foreground color for the specified text range.
range (Range<int>)Range to set the foreground color.
color (Color)Color to set the text foreground in the range.

SetItalic

#
void SetItalic(Range<int> range, bool italic)
Sets the italic flag for the specified text range.
range (Range<int>)Range to set the italics.
italic (bool)If set to true, then text will be italic.

SetStrikethrough

#
void SetStrikethrough(Range<int> range, bool strikethrough)
Sets the strikethrough for the specified text range.
range (Range<int>)Range to set the strikethrough.
strikethrough (bool)If set to true, then the text will be strikethrough.

SetUnderline

#
void SetUnderline(Range<int> range, bool underline)
Sets the underline flag for the specified text range.
range (Range<int>)Range to set the underline.
underline (bool)If set to true, then the text will be underline.