IVerticalFractionMap::GetBufferPositionAtFraction Method (Double)

 

Gets the buffer position that corresponds to a fraction of the vertical extent of the view, if it exists.

Namespace:   Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

SnapshotPoint GetBufferPositionAtFraction(
	double fraction
)

Parameters

fraction
Type: System::Double

The fraction of the vertical extent of the view.

Return Value

Type: Microsoft.VisualStudio.Text::SnapshotPoint

The corresponding character position.

Exception Condition
ArgumentOutOfRangeException

fraction is NaN, less than 0.0 or greater than 1.0.

Different buffer positions can have the same fractions. This method is guaranteed only to be consistent: it will return the same position for the same fraction. The exact character returned depends on the implementation of the fraction map. In general, it is the first character on the line, but this is not guaranteed.

Return to top
Show: