In This Article

TextViewScrollState Struct

Represents a scroll state within an ITextView.

public struct TextViewScrollState

Constructors

TextViewScrollState(TextPosition)

Initializes a new instance of the TextViewScrollState class, using TextViewVerticalAnchorPlacement.Top and no vertical amount offset.

public TextViewScrollState(TextPosition verticalAnchorTextPosition)
Parameter Type Description
verticalAnchorTextPosition TextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

TextViewScrollState(TextPosition, TextViewVerticalAnchorPlacement, double, double)

Initializes a new instance of the TextViewScrollState class.

public TextViewScrollState(TextPosition verticalAnchorTextPosition, TextViewVerticalAnchorPlacement verticalAnchorPlacement, double verticalAmountOffset, double horizontalAmount)
Parameter Type Description
verticalAnchorTextPosition TextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

verticalAnchorPlacement TextViewVerticalAnchorPlacement

A TextViewVerticalAnchorPlacement indicating the placement of the anchor view line.

verticalAmountOffset double

The vertical scroll amount to move the anchor view line from its placement, where a positive number means downward and a negative number means upward.

horizontalAmount double

The horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view.

TextViewScrollState(TextPosition, double)

Initializes a new instance of the TextViewScrollState class, using TextViewVerticalAnchorPlacement.Top and no vertical amount offset.

public TextViewScrollState(TextPosition verticalAnchorTextPosition, double horizontalAmount)
Parameter Type Description
verticalAnchorTextPosition TextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

horizontalAmount double

The horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view.

Properties

CanScrollPastDocumentEnd

Gets or sets whether the view can scroll past the document end.

public bool CanScrollPastDocumentEnd { get; set; }

Property Value

bool:

true if the view can scroll past the document end; otherwise, false. The default value is false.

HorizontalAmount

Gets or sets the horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view.

public double HorizontalAmount { get; set; }

Property Value

double:

The horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view. The default value is 0.

VerticalAmountOffset

Gets the vertical scroll amount to move the anchor view line from its placement, where a positive number means downward and a negative number means upward.

public double VerticalAmountOffset { get; set; }

Property Value

double:

The vertical scroll amount to move the anchor view line from its placement, where a positive number means downward and a negative number means upward. The default value is 0.

VerticalAnchorPlacement

Gets or sets a TextViewVerticalAnchorPlacement indicating the placement of the anchor view line.

public TextViewVerticalAnchorPlacement VerticalAnchorPlacement { get; set; }

Property Value

TextViewVerticalAnchorPlacement:

A TextViewVerticalAnchorPlacement indicating the placement of the anchor view line. The default value is Top.

VerticalAnchorTextPosition

Gets or sets a TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

public TextPosition VerticalAnchorTextPosition { get; set; }

Property Value

TextPosition:

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

Methods

Equals(object)

Determines whether the specified Object is equal to the current Object.

public override bool Equals(object obj)
Parameter Type Description
obj object

The Object to compare to the current Object.

Returns

bool:

true if the specified Object is equal to the current Object; otherwise, false.

GetHashCode()

Returns a hash code for this object.

public override int GetHashCode()

Returns

int:

An integer value that specifies a hash value for this object.

Operators

operator ==(TextViewScrollState, TextViewScrollState)

Compares two TextViewScrollState objects. The result specifies whether the property values of the two TextViewScrollState objects are equal.

public static bool operator ==(TextViewScrollState left, TextViewScrollState right)
Parameter Type Description
left TextViewScrollState

A TextViewScrollState to compare.

right TextViewScrollState

A TextViewScrollState to compare.

Returns

bool:

true if the property values of are equal; otherwise, false.

operator !=(TextViewScrollState, TextViewScrollState)

Compares two TextViewScrollState objects. The result specifies whether the property values of the two TextViewScrollState objects are unequal.

public static bool operator !=(TextViewScrollState left, TextViewScrollState right)
Parameter Type Description
left TextViewScrollState

A TextViewScrollState to compare.

right TextViewScrollState

A TextViewScrollState to compare.

Returns

bool:

true if the property values of are unequal; otherwise, false.

Inherited Members