Table of Contents

Class DisplayStrings

Namespace
Alternet.Editor
Assembly
Alternet.Editor.v9.dll

Represents a collection of visible strings in the text Edit control.

public class DisplayStrings : IDisplayStrings, IStringList, IList<string>, ICollection<string>, IEnumerable<string>, IEnumerable, ITabulation, IWordWrap, ITextSearch, IUpdate, IWordBreak, ICollapsable, ITextExport, IExport, ITextImport, IImport
Inheritance
DisplayStrings
Implements
Extension Methods

Remarks

Use SyntaxStrings to access "real" lines stored in the TextSource. DisplayStrings provides an access to lines as they are displayed in the Edit control, assuming tabulation, wordwrap and outlining.

Constructors

DisplayStrings(ISyntaxEdit, ITextStrings)

Initializes a new instance of the DisplayStrings class with specified parameters.

Properties

AllowHiddenLines

Gets or sets a value indicating whether hidden lines are enabled.

AllowOutlining

Gets or sets a value indicating whether outlining is enabled.

CollapsedCount

Returns number of collapsed sections.

Count

Returns number of visible lines.

DelimiterString

Gets or sets Delimiters as a single string.

Delimiters

Gets or sets an array of chars used to separate words in a text.

DisplayCount

Returns number of visible lines.

IgnoreWhiteSpace

Gets or sets boolean value indicating if white space styles are suppressed.

IsReadOnly

Gets a value indicating whether the collection is read-only.

this[int]

Provides an indexed access to individual string stored in the collection.

LineEnd

When implemented by a class, gets or sets boolean value indicating if the text position can be set to the end of the wrapped line.

LineTerminator

Gets or sets a string value that terminates line.

Lines

Gets or sets the collection of underlying "real" collection of text lines.

Loaded

Gets or sets boolean value indicating if the display strings was fully formatted.

MaxLineWidth

Gets width of the largest line in the DisplayString object.

OutlineOptions

Gets or sets options representing outlining appearance and behaviour. OutlineOptions

SuppressTabs

Gets or sets boolean value indicating if conversion from tabs to spaces is suppressed.

TabStops

Gets or sets the character columns that the cursor will move to each time you press Tab.

Text

Gets or sets the strings in the IDisplayStrings as a single string with the individual strings delimited by carriage returns.

UpdateCount

Keeps track of calls to BeginUndoUpdate and EndUndoUpdate so that they can be nested.

UseSpaces

Gets or sets a value indicating whether indent operations insert space characters rather than TAB characters.

WordWrap

Gets or sets a value indicating whether a DisplayStrings object automatically wraps words to the beginning of the next line when necessary.

WrapAtMargin

Gets or sets a value indicating whether a DisplayStrings object automatically wraps words at margin position.

WrapMargin

Gets position of the wrap margin.

Methods

Add(string)

Adds a new item to the end of string collection.

ApplyWhiteSpace(string, ref StringItemInfo[])
BeginUpdate()

Prevents outline list updating until calling ICollapsable.EndUpdate method.

BlockDeleting(Rectangle)

Responds on deleting some block of lines within the editor control.

CanCollapse(int)

Returns boolean value indicating that outline section at given line can be collapsed.

CanExpand(IOutlineRange)

Returns boolean value indicating that given outline section can be expanded.

CanExpand(int)

Returns boolean value indicating that outline section at given line can be expanded.

Clear()

Removes all items from string collection.

Collapse(int)

Collapses the specified line.

CollapseToDefinitions()

Collapses and expands some outline section to get a quick overall view of the content.

Contains(string)

Indicates whether string collection contains specified string.

CopyTo(string[], int)

Copies the entire string collection to a another array, starting at the specified index of the target array.

DisableUpdate()

Prevents object state updating until calling EnableUpdate method.

DisplayPointToPoint(Point)

Converts the specified display coordinates to text coordinates.

DisplayPointToPoint(int, int)

Converts the specified display coordinates to text coordinates.

DisplayPointToPoint(int, int, bool, bool, bool)

Converts the specified display coordinates to the text coordinates.

DisplayPointToPoint(int, int, bool, bool, bool, ref bool)
DisplayPointToPoint(int, int, ref bool)

Converts the specified display coordinates to the text coordinates.

EnableUpdate()

Re-enables object state updating, that was turn of by calling DisableUpdate method. Using DisableUpdate/EnableUpdate to prevent notifying about updating the object state.

EndUpdate()

Re-enables outline list updating, that was turn of by calling ICollapsable.BeginUpdate method.

EnsureExpanded(Point)

Makes all outline sections containing specified position expanded.

EnsureExpanded(int)

Makes all outline sections containing specified line expanded.

Expand(int)

Expands outline section at the given line.

Find(string, SearchOptions, Regex, ref Point, out int, out Match, bool)

Searches for given text within the DisplayStrings contents.

FullCollapse()

Collapses all outline sections objects within DisplayStrings.

FullCollapse(IList<IRange>)

Collapses all sections objects specified by Ranges parameter.

FullExpand()

Expands all outline sections objects within DisplayStrings.

FullExpand(IList<IRange>)

Expands all outline sections specified by Ranges parameter.

GetColorData(int)

Returns color information related to the specified line.

GetEnumerator()

Returns an enumerator that iterates through a collection.

GetIndentString(int, int)

Returns indentation string which consist of tabs and spaces.

GetIndentString(int, int, bool)

Returns indentation string which consist of tabs and spaces.

GetLexStyle(Point)

Returns lexical style related to the specified position.

GetOutlineHint(IOutlineRange)

Returns the string that appears in the hint window when mouse pointer over the outline button.

GetOutlineRange(Point)

Returns outline section representing text substituting outline section and level of outline nesting at the specific position. IOutlineRange

GetOutlineRange(int)

Returns outline section, which represents text substring outline section and level of outline nesting at the specific line. IOutlineRange

GetOutlineRanges(IList<IRange>)

Fills list specified by Ranges parameter with all existing outline sections.

GetOutlineRanges(IList<IRange>, Point)

Fills list specified by Ranges parameter with all outline sections containing specific position.

GetOutlineRanges(IList<IRange>, Point, Point)

Fills list specified by Ranges parameter with all outline sections containing specific range.

GetOutlineRanges(IList<IRange>, int)

Fills list specified by Ranges parameter with all outline sections containing specific line.

GetPrevTabStop(int)

Returns number of spaces to the previous TabStop.

GetString(int, ref string, ref StringItemInfo[], bool, bool)
GetStringAndColorData(int, ref string, ref StringItemInfo[])

Returns text and color information related to the specified line.

GetStringAndColorData(int, ref string, ref StringItemInfo[], bool)
GetTabStop(int)

Returns number of spaces to the next TabStop at the specified position.

GetTabString(string)

Converts all tab character to spaces depending on ITabulation.TabStops property.

GetTabString(string, ITextUndoList)

Converts all tab character to spaces depending on ITabulation.TabStops property.

GetTextAt(Point)

Returns word at the specific text position.

GetTextAt(int, int)

Returns word at the specific text position.

GetVisibleLines(out int, out int)

Gets max range containing visible lines

GetWord(int, int, out int, out int)

Returns word start and end, if there is word at the specified position.

GetWord(string, int, out int, out int)

Returns word start and end, if there is word at the specified position.

GetWord(string, int, out int, out int, char[])

Returns word start and end, if there is word at the specified position.

GetWord(string, int, out int, out int, Hashtable)

Returns word start and end, if there is word at the specified position.

GetWrapMargin()

Returns position of the wrap margin.

IndexOf(string)

Returns the index of the first occurrence of given string in the string collection.

Insert(int, string)

Inserts value at the specified position.

IsCollapsed(int)

Indicates whether the outline section at the specified line is collapsed. IsExpanded(int)

IsDelimiter(char)

Indicates whether the specified character is delimiter character.

IsDelimiter(int, int)

Indicates whether the character at the specific position of the string collection is word delimiter character.

IsDelimiter(string, int)

Indicates whether the character at the specific position of string is word delimiter character.

IsExpanded(int)

Indicates whether the outlined section at the specified line is expanded. IsCollapsed(int)

IsPointCollapsed(Point, out IRange)

Indicates whether given position is in visible area of the editor control.

IsPointVisible(Point)

Indicates whether given position is in visible area of the editor control.

IsVisible(Point)

Indicates whether the text at the specified position is visible, that is there is no collapsed outline section containing given position.

IsVisible(int)

Indicates whether the text at the specified line is visible, that is there is no collapsed outline section containing given line.

IsWhitespace(string, int)

Indicates whether the character at the specific position of the string collection is a whitespace character.

LinesChanged()
LoadFile(string)

Loads the contents of a text file into string collection.

LoadFile(string, IStringImport)

Loads content from the given file with specified importer.

LoadFile(string, IStringImport, Encoding)

Loads content from the given file with specified importer and specific encoding.

LoadFile(string, Encoding)

Loads the contents of a file into string collection.

LoadStream(Stream)

Loads the contents of a stream into string collection.

LoadStream(Stream, IStringImport)

Loads the text content from the given stream with specified importer.

LoadStream(Stream, IStringImport, Encoding)

Loads the text content from the given stream with specified importer.

LoadStream(Stream, Encoding)

Loads the contents of the specified stream.

LoadStream(TextReader)

Loads the contents of a stream into string collection.

LoadStream(TextReader, IStringImport)

Loads the contents of the specified stream.

Notify(NotifyState, int, int)

Notifies editor about updating IDisplayStrings state.

Notify(NotifyState, int, int, bool)
OnAllowHiddenLinesChanged()
OnAllowOutliningChanged()
OnDelimiterStringChanged()
OnDelimitersChanged()
OnLineEndChanged()
OnOutlineOptionsChanged()
OnTabStopsChanged()
OnUseSpacesChanged()
Outline(Point, Point)

This method creates an outlining section based on specific scope.

Outline(Point, Point, int)

This method creates an outlining section based on specific scope with the specific level of outline nesting.

Outline(Point, Point, int, string)

This method creates an outlining section based on specific scope with specific level of outline nesting and specific text substituting collapsed section.

Outline(Point, Point, string)

This method creates an outlining section based on specific scope within current outlined section and with specific text substituting collapsed section.

Outline(int, int)

This method creates an outlining section based on specific scope.

Outline(int, int, int)

This method creates an outlining section based on specific scope at the specific level of outline nesting.

Outline(int, int, int, string)

This method creates an outlining section based on specific scope at specific level of outline nesting and with specific text substituting collapsed section.

Outline(int, int, string)

This method creates an outlining section based on specific scope within current outlined section and with specific text substituting collapsed section.

PointToDisplayPoint(Point)

Converts the specified text coordinates into display coordinates.

PointToDisplayPoint(int, int)

Converts the specified text coordinates into display coordinates.

PointToDisplayPoint(int, int, bool)

Converts the specified text coordinates to display coordinates.

PosToTabPos(string, int)

Returns specified position within given string as tabbed position.

PosToTabPos(string, int, bool)

Returns specified position within given string as tabbed position.

PositionChanged(UpdateReason, int, int, int, int)

Responds on changing position in the editor.

Remove(string)

Removes the first occurrence of given string from the string collection.

RemoveAt(int)

Removes string item at specified position.

RemoveHiddenRanges()
ResetAllowOutlining()

Resets the AllowOutlining to its default value.

ResetDelimiters()

Resets the Delimiters to the default value.

ResetOutlineOptions()

Resets the OutlineOptions to its default value.

ResetTabStops()

Resets the TabStops to the default value.

ResetUseSpaces()

Resets the UseSpaces to the default value.

ResetWordWrap()

Resets the WordWrap to its default value.

ResetWrapAtMargin()

Resets the WrapAtMargin to its default value.

SaveFile(string)

Saves content to the specific file in the text format.

SaveFile(string, IStringExport)

Saves content to the specific file in the specific format.

SaveFile(string, IStringExport, Encoding)

Saves content to the specific file in the specific format with specific encoding.

SaveFile(string, Encoding)

Saves content to the specific file with specific encoding.

SaveStream(Stream)

Saves content to the specific stream in the text format.

SaveStream(Stream, IStringExport)

Saves content to the specific stream in the specific format.

SaveStream(Stream, IStringExport, Encoding)

Saves content to the specific stream in the specific format and specific encoding.

SaveStream(Stream, Encoding)

Saves the text content to the specified stream.

SaveStream(TextWriter)

Saves content to the specific stream in the text format.

SaveStream(TextWriter, IStringExport)

Saves the text content to the specified stream.

ScanToEnd(bool)
SetOutlineRanges(IList<IRange>)

Updates IOutlineRange collection from given list of ranges.

SetOutlineRanges(IList<IRange>, bool)

Updates IOutlineRange collection from given list of ranges.

TabPosToPos(string, int)

Returns specified position within given string as untabbed position.

ToggleOutlining()

Toggles expanded state for current outline sections.

ToggleOutlining(IList<IRange>, IOutlineRange)

Toggles expanded state for given IOutlineRange collection.

UnOutline()

This method removes all outlined section within the DisplayStrings collection.

UnOutline(Point)

This method removes outlined section at the specific position.

UnOutline(int)

This method removes all outlined section containing the given line.

Update()

When implemented by a class, updates an object state.

UpdateHiddenLines()

Updates outline ranges for the hidden lines

UpdateNeeded()

Forces IDisplayStrings to recalculate its content.

UpdateOutlining()
UpdateWordWrap()

Re-wraps all lines in DisplayStrings collection.

UpdateWordWrap(int, int)

Updates wrapped lines within specific scope in DisplayStrings object.

WrapLine(int, IEditPages, ref int, int, ref int, ref int, bool)

Events

Collapsing

Occurs when user attempts expand outline section.

Expanding

Occurs when user attempts expand outline section.