New to Telerik UI for WPFStart a free 30-day trial

Editing, Scrolling, Layers.

Definition

Namespace:Telerik.Windows.Controls.SyntaxEditor.UI

Assembly:Telerik.Windows.Controls.SyntaxEditor.dll

Syntax:

C#
public class SyntaxEditorPresenter : ContentControl, ISyntaxEditorPresenter, IDisposable

Inheritance: objectSyntaxEditorPresenter

Implements: IDisposableISyntaxEditorPresenter

Constructors

Initializes a new instance of the SyntaxEditorPresenter class.

C#
public SyntaxEditorPresenter()

Fields

The drag margin.

C#
protected static readonly double DragMargin

The maximum size constant.

C#
public static readonly Size MaxSize

Properties

Gets the caret.

C#
public Caret Caret { get; }
Property Value:

The caret.

Gets or sets the caret display mode.

C#
public CaretDisplayMode CaretDisplayMode { get; set; }
Property Value:

The caret display mode.

Gets or sets the horizontal scroll offset.

C#
public double HorizontalScrollOffset { get; protected set; }
Property Value:

The horizontal scroll offset.

Gets a value indicating whether this instance is presenter focused.

C#
public bool IsPresenterFocused { get; }
Property Value:

true if this instance is presenter focused; otherwise, false.

Gets or sets the owner.

C#
public RadSyntaxEditor Owner { get; set; }
Property Value:

The owner.

Gets or sets the vertical scroll offset.

C#
public double VerticalScrollOffset { get; protected set; }
Property Value:

The vertical scroll offset.

Gets the viewport.

C#
public Rect Viewport { get; }
Property Value:

The viewport.

Implements: ISyntaxEditorPresenter.Viewport

Methods

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

C#
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters:arrangeBoundsSize

The final area within the parent that this element should use to arrange itself and its children.

Returns:

Size

The actual size used.

Called when instance is disposed.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Releases unmanaged and - optionally - managed resources.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Focuses the caret.

C#
public void FocusCaret()

Gets the document point from position.

C#
public Point GetDocumentPointFromPosition(CaretPosition position)
Parameters:positionCaretPosition

The position.

Returns:

Point

Point.

Implements: ISyntaxEditorPresenter.GetDocumentPointFromPosition(CaretPosition)

Gets the document point from view point.

C#
public Point GetDocumentPointFromViewPoint(Point point)
Parameters:pointPoint

The point.

Returns:

Point

Point.

Implements: ISyntaxEditorPresenter.GetDocumentPointFromViewPoint(Point)

Gets the position from view point.

C#
public CaretPosition GetPositionFromViewPoint(Point point)
Parameters:pointPoint

The position.

Returns:

CaretPosition

CaretPosition.

Implements: ISyntaxEditorPresenter.GetPositionFromViewPoint(Point)

Gets the view point from document point.

C#
public Point GetViewPointFromDocumentPoint(Point point)
Parameters:pointPoint

The point.

Returns:

Point

Point.

Implements: ISyntaxEditorPresenter.GetViewPointFromDocumentPoint(Point)

Gets the view point from position.

C#
public Point GetViewPointFromPosition(CaretPosition position)
Parameters:positionCaretPosition

The position.

Returns:

Point

Point.

Implements: ISyntaxEditorPresenter.GetViewPointFromPosition(CaretPosition)

Hides the drop marker.

C#
public void HideDropMarker()

Implements: ISyntaxEditorPresenter.HideDropMarker()

Invalidates the and update layout.

C#
protected void InvalidateAndUpdateLayout()

Invalidates the layout.

C#
protected void InvalidateLayout()

Invalidates the layout.

C#
public void InvalidateLayout(bool force)
Parameters:forcebool

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

C#
protected override Size MeasureOverride(Size constraint)
Parameters:constraintSize

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns:

Size

The size that this element determines it needs during layout, based on its calculations of child element sizes.

Moves the caret to position in view.

C#
public void MoveCaretToPositionInView(CaretPosition caretPosition, Point positionInView, bool moveToNextIfOutOfBox)
Parameters:caretPositionCaretPosition

The caret position.

positionInViewPoint

The position in view.

moveToNextIfOutOfBoxbool

If set to true [move to next if out of box].

Implements: ISyntaxEditorPresenter.MoveCaretToPositionInView(CaretPosition, Point, bool)

Moves the drop marker.

C#
public void MoveDropMarker(CaretPosition position)
Parameters:positionCaretPosition

The position.

Implements: ISyntaxEditorPresenter.MoveDropMarker(CaretPosition)

Invoked whenever an unhandled event reaches this element in its route.

C#
protected override void OnGotFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

The RoutedEventArgs that contains the event data.

Invoked when an unhandled  routed event is raised on this element. Implement this method to add class handling for this event.

C#
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed.

Invoked when an unhandled  routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

C#
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was released.

Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

C#
protected override void OnMouseMove(MouseEventArgs e)
Parameters:eMouseEventArgs

The MouseEventArgs that contains the event data.

Invoked when an unhandled  routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

C#
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was pressed.

Called when [viewport changed].

C#
protected virtual void OnViewportChanged()

Sets the horizontal offset.

C#
public void SetHorizontalOffset(double offset)
Parameters:offsetdouble

The offset.

Sets the vertical offset.

C#
public void SetVerticalOffset(double offset)
Parameters:offsetdouble

The offset.

Shows the drop marker.

C#
public void ShowDropMarker(CaretPosition position)
Parameters:positionCaretPosition

The position.

Implements: ISyntaxEditorPresenter.ShowDropMarker(CaretPosition)

Updates the scroll bar.

C#
protected static void UpdateScrollBar(double viewportSize, double max, ScrollBar scrollBar, ScrollBarVisibility suggestedVisibility)
Parameters:viewportSizedouble

Size of the viewport.

maxdouble

The maximum.

scrollBarScrollBar

The scroll bar.

suggestedVisibilityScrollBarVisibility

The suggested visibility.

Events

Occurs when [viewport changed].

C#
public event EventHandler ViewportChanged

Implements: ISyntaxEditorPresenter.ViewportChanged