C# Класс ICSharpCode.AvalonEdit.TextEditor

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DocumentProperty System.Windows.DependencyProperty
HorizontalScrollBarVisibilityProperty System.Windows.DependencyProperty
IsModifiedProperty System.Windows.DependencyProperty
IsReadOnlyProperty System.Windows.DependencyProperty
LineNumbersForegroundProperty System.Windows.DependencyProperty
MouseHoverEvent System.Windows.RoutedEvent
MouseHoverStoppedEvent System.Windows.RoutedEvent
OptionsProperty System.Windows.DependencyProperty
PreviewMouseHoverEvent System.Windows.RoutedEvent
PreviewMouseHoverStoppedEvent System.Windows.RoutedEvent
ShowLineNumbersProperty System.Windows.DependencyProperty
SyntaxHighlightingProperty System.Windows.DependencyProperty
VerticalScrollBarVisibilityProperty System.Windows.DependencyProperty
WordWrapProperty System.Windows.DependencyProperty

Private Properties

Свойство Тип Описание
CanExecute bool
Execute void
GetDocument ICSharpCode.AvalonEdit.Document.TextDocument
HandleIsOriginalChanged bool
IServiceProvider object
IWeakEventListener bool
OnDocumentChanged void
OnDocumentChanged void
OnIsModifiedChanged void
OnIsReadOnlyChanged void
OnLineNumbersForegroundChanged void
OnOptionsChanged void
OnOptionsChanged void
OnShowLineNumbersChanged void
OnSyntaxHighlightingChanged void
OnSyntaxHighlightingChanged void
SetCurrentValue void
TextArea_SelectionChanged void
TextEditor System

Открытые методы

Метод Описание
AppendText ( string textData ) : void

Appends text to the end of the document.

BeginChange ( ) : void

Begins a group of document changes.

Clear ( ) : void

Clears the text.

Copy ( ) : void

Copies the current selection to the clipboard.

Cut ( ) : void

Removes the current selection and copies it to the clipboard.

DeclareChangeBlock ( ) : IDisposable

Begins a group of document changes and returns an object that ends the group of document changes when it is disposed.

EndChange ( ) : void

Ends the current group of document changes.

GetPositionFromPoint ( Point point ) : TextViewPosition?

Gets the text view position from a point inside the editor.

LineDown ( ) : void

Scrolls one line down.

LineLeft ( ) : void

Scrolls to the left.

LineRight ( ) : void

Scrolls to the right.

LineUp ( ) : void

Scrolls one line up.

Load ( System.Stream stream ) : void

Loads the text from the stream, auto-detecting the encoding.

This method sets IsModified to false.

Load ( string fileName ) : void

Loads the text from the stream, auto-detecting the encoding.

OnApplyTemplate ( ) : void

Is called after the template was applied.

PageDown ( ) : void

Scrolls one page down.

PageLeft ( ) : void

Scrolls one page left.

PageRight ( ) : void

Scrolls one page right.

PageUp ( ) : void

Scrolls one page up.

Paste ( ) : void

Pastes the clipboard content.

Redo ( ) : bool

Redoes the most recent undone command.

Save ( System.Stream stream ) : void

Saves the text to the stream.

This method sets IsModified to false.

Save ( string fileName ) : void

Saves the text to the file.

ScrollTo ( int line, int column ) : void

Scrolls to the specified line/column. This method requires that the TextEditor was already assigned a size (WPF layout must have run prior).

ScrollToEnd ( ) : void

Scrolls to the end of the document.

ScrollToHome ( ) : void

Scrolls to the start of the document.

ScrollToHorizontalOffset ( double offset ) : void

Scrolls to the specified position in the document.

ScrollToLine ( int line ) : void

Scrolls to the specified line. This method requires that the TextEditor was already assigned a size (WPF layout must have run prior).

ScrollToVerticalOffset ( double offset ) : void

Scrolls to the specified position in the document.

Select ( int start, int length ) : void

Selects the specified text section.

SelectAll ( ) : void

Selects the entire text.

Undo ( ) : bool

Undoes the most recent command.

Защищенные методы

Метод Описание
CreateColorizer ( IHighlightingDefinition highlightingDefinition ) : IVisualLineTransformer

Creates the highlighting colorizer for the specified highlighting definition. Allows derived classes to provide custom colorizer implementations for special highlighting definitions.

OnCreateAutomationPeer ( ) : System.Windows.Automation.Peers.AutomationPeer
OnDocumentChanged ( EventArgs e ) : void

Raises the DocumentChanged event.

OnGotKeyboardFocus ( KeyboardFocusChangedEventArgs e ) : void
OnMouseRightButtonDown ( MouseButtonEventArgs e ) : void
OnOptionChanged ( PropertyChangedEventArgs e ) : void

Raises the OptionChanged event.

OnTextChanged ( EventArgs e ) : void

Raises the TextChanged event.

ReceiveWeakEvent ( Type managerType, object sender, EventArgs e ) : bool
TextEditor ( TextArea textArea ) : System

Creates a new TextEditor instance.

Приватные методы

Метод Описание
CanExecute ( RoutedUICommand command ) : bool
Execute ( RoutedUICommand command ) : void
GetDocument ( ) : TextDocument
HandleIsOriginalChanged ( PropertyChangedEventArgs e ) : bool
IServiceProvider ( Type serviceType ) : object
IWeakEventListener ( Type managerType, object sender, EventArgs e ) : bool
OnDocumentChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnDocumentChanged ( TextDocument oldValue, TextDocument newValue ) : void
OnIsModifiedChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnIsReadOnlyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnLineNumbersForegroundChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnOptionsChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnOptionsChanged ( TextEditorOptions oldValue, TextEditorOptions newValue ) : void
OnShowLineNumbersChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnSyntaxHighlightingChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnSyntaxHighlightingChanged ( IHighlightingDefinition newValue ) : void
SetCurrentValue ( DependencyProperty property, object value ) : void
TextArea_SelectionChanged ( object sender, EventArgs e ) : void
TextEditor ( ) : System

Описание методов

AppendText() публичный Метод

Appends text to the end of the document.
public AppendText ( string textData ) : void
textData string
Результат void

BeginChange() публичный Метод

Begins a group of document changes.
public BeginChange ( ) : void
Результат void

Clear() публичный Метод

Clears the text.
public Clear ( ) : void
Результат void

Copy() публичный Метод

Copies the current selection to the clipboard.
public Copy ( ) : void
Результат void

CreateColorizer() защищенный Метод

Creates the highlighting colorizer for the specified highlighting definition. Allows derived classes to provide custom colorizer implementations for special highlighting definitions.
protected CreateColorizer ( IHighlightingDefinition highlightingDefinition ) : IVisualLineTransformer
highlightingDefinition IHighlightingDefinition
Результат IVisualLineTransformer

Cut() публичный Метод

Removes the current selection and copies it to the clipboard.
public Cut ( ) : void
Результат void

DeclareChangeBlock() публичный Метод

Begins a group of document changes and returns an object that ends the group of document changes when it is disposed.
public DeclareChangeBlock ( ) : IDisposable
Результат IDisposable

EndChange() публичный Метод

Ends the current group of document changes.
public EndChange ( ) : void
Результат void

GetPositionFromPoint() публичный Метод

Gets the text view position from a point inside the editor.
public GetPositionFromPoint ( Point point ) : TextViewPosition?
point Point The position, relative to top left /// corner of TextEditor control
Результат TextViewPosition?

LineDown() публичный Метод

Scrolls one line down.
public LineDown ( ) : void
Результат void

LineLeft() публичный Метод

Scrolls to the left.
public LineLeft ( ) : void
Результат void

LineRight() публичный Метод

Scrolls to the right.
public LineRight ( ) : void
Результат void

LineUp() публичный Метод

Scrolls one line up.
public LineUp ( ) : void
Результат void

Load() публичный Метод

Loads the text from the stream, auto-detecting the encoding.
This method sets IsModified to false.
public Load ( System.Stream stream ) : void
stream System.Stream
Результат void

Load() публичный Метод

Loads the text from the stream, auto-detecting the encoding.
public Load ( string fileName ) : void
fileName string
Результат void

OnApplyTemplate() публичный Метод

Is called after the template was applied.
public OnApplyTemplate ( ) : void
Результат void

OnCreateAutomationPeer() защищенный Метод

protected OnCreateAutomationPeer ( ) : System.Windows.Automation.Peers.AutomationPeer
Результат System.Windows.Automation.Peers.AutomationPeer

OnDocumentChanged() защищенный Метод

Raises the DocumentChanged event.
protected OnDocumentChanged ( EventArgs e ) : void
e System.EventArgs
Результат void

OnGotKeyboardFocus() защищенный Метод

protected OnGotKeyboardFocus ( KeyboardFocusChangedEventArgs e ) : void
e KeyboardFocusChangedEventArgs
Результат void

OnMouseRightButtonDown() защищенный Метод

protected OnMouseRightButtonDown ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs
Результат void

OnOptionChanged() защищенный Метод

Raises the OptionChanged event.
protected OnOptionChanged ( PropertyChangedEventArgs e ) : void
e System.ComponentModel.PropertyChangedEventArgs
Результат void

OnTextChanged() защищенный Метод

Raises the TextChanged event.
protected OnTextChanged ( EventArgs e ) : void
e System.EventArgs
Результат void

PageDown() публичный Метод

Scrolls one page down.
public PageDown ( ) : void
Результат void

PageLeft() публичный Метод

Scrolls one page left.
public PageLeft ( ) : void
Результат void

PageRight() публичный Метод

Scrolls one page right.
public PageRight ( ) : void
Результат void

PageUp() публичный Метод

Scrolls one page up.
public PageUp ( ) : void
Результат void

Paste() публичный Метод

Pastes the clipboard content.
public Paste ( ) : void
Результат void

ReceiveWeakEvent() защищенный Метод

protected ReceiveWeakEvent ( Type managerType, object sender, EventArgs e ) : bool
managerType System.Type
sender object
e System.EventArgs
Результат bool

Redo() публичный Метод

Redoes the most recent undone command.
public Redo ( ) : bool
Результат bool

Save() публичный Метод

Saves the text to the stream.
This method sets IsModified to false.
public Save ( System.Stream stream ) : void
stream System.Stream
Результат void

Save() публичный Метод

Saves the text to the file.
public Save ( string fileName ) : void
fileName string
Результат void

ScrollTo() публичный Метод

Scrolls to the specified line/column. This method requires that the TextEditor was already assigned a size (WPF layout must have run prior).
public ScrollTo ( int line, int column ) : void
line int
column int
Результат void

ScrollToEnd() публичный Метод

Scrolls to the end of the document.
public ScrollToEnd ( ) : void
Результат void

ScrollToHome() публичный Метод

Scrolls to the start of the document.
public ScrollToHome ( ) : void
Результат void

ScrollToHorizontalOffset() публичный Метод

Scrolls to the specified position in the document.
public ScrollToHorizontalOffset ( double offset ) : void
offset double
Результат void

ScrollToLine() публичный Метод

Scrolls to the specified line. This method requires that the TextEditor was already assigned a size (WPF layout must have run prior).
public ScrollToLine ( int line ) : void
line int
Результат void

ScrollToVerticalOffset() публичный Метод

Scrolls to the specified position in the document.
public ScrollToVerticalOffset ( double offset ) : void
offset double
Результат void

Select() публичный Метод

Selects the specified text section.
public Select ( int start, int length ) : void
start int
length int
Результат void

SelectAll() публичный Метод

Selects the entire text.
public SelectAll ( ) : void
Результат void

TextEditor() защищенный Метод

Creates a new TextEditor instance.
protected TextEditor ( TextArea textArea ) : System
textArea TextArea
Результат System

Undo() публичный Метод

Undoes the most recent command.
public Undo ( ) : bool
Результат bool

Описание свойств

DocumentProperty публичное статическое свойство

Document property.
public static DependencyProperty,System.Windows DocumentProperty
Результат System.Windows.DependencyProperty

HorizontalScrollBarVisibilityProperty публичное статическое свойство

Dependency property for HorizontalScrollBarVisibility
public static DependencyProperty,System.Windows HorizontalScrollBarVisibilityProperty
Результат System.Windows.DependencyProperty

IsModifiedProperty публичное статическое свойство

Dependency property for IsModified
public static DependencyProperty,System.Windows IsModifiedProperty
Результат System.Windows.DependencyProperty

IsReadOnlyProperty публичное статическое свойство

IsReadOnly dependency property.
public static DependencyProperty,System.Windows IsReadOnlyProperty
Результат System.Windows.DependencyProperty

LineNumbersForegroundProperty публичное статическое свойство

LineNumbersForeground dependency property.
public static DependencyProperty,System.Windows LineNumbersForegroundProperty
Результат System.Windows.DependencyProperty

MouseHoverEvent публичное статическое свойство

The MouseHover event.
public static RoutedEvent,System.Windows MouseHoverEvent
Результат System.Windows.RoutedEvent

MouseHoverStoppedEvent публичное статическое свойство

The MouseHoverStopped event.
public static RoutedEvent,System.Windows MouseHoverStoppedEvent
Результат System.Windows.RoutedEvent

OptionsProperty публичное статическое свойство

Options property.
public static DependencyProperty,System.Windows OptionsProperty
Результат System.Windows.DependencyProperty

PreviewMouseHoverEvent публичное статическое свойство

The PreviewMouseHover event.
public static RoutedEvent,System.Windows PreviewMouseHoverEvent
Результат System.Windows.RoutedEvent

PreviewMouseHoverStoppedEvent публичное статическое свойство

The PreviewMouseHoverStopped event.
public static RoutedEvent,System.Windows PreviewMouseHoverStoppedEvent
Результат System.Windows.RoutedEvent

ShowLineNumbersProperty публичное статическое свойство

ShowLineNumbers dependency property.
public static DependencyProperty,System.Windows ShowLineNumbersProperty
Результат System.Windows.DependencyProperty

SyntaxHighlightingProperty публичное статическое свойство

The SyntaxHighlighting property.
public static DependencyProperty,System.Windows SyntaxHighlightingProperty
Результат System.Windows.DependencyProperty

VerticalScrollBarVisibilityProperty публичное статическое свойство

Dependency property for VerticalScrollBarVisibility
public static DependencyProperty,System.Windows VerticalScrollBarVisibilityProperty
Результат System.Windows.DependencyProperty

WordWrapProperty публичное статическое свойство

Word wrap dependency property.
public static DependencyProperty,System.Windows WordWrapProperty
Результат System.Windows.DependencyProperty