Share via


IDifferenceBuffer Interface

A difference buffer constantly computes the differences between two ITextBuffers, providing an IProjectionBuffer, TopLevelBuffer, that contains the differences between the two ITextBuffers in an inline difference.

Namespace:  Microsoft.VisualStudio.Data.Tools.Delta
Assembly:  Microsoft.VisualStudio.Data.Tools.Delta (in Microsoft.VisualStudio.Data.Tools.Delta.dll)

Syntax

'Declaration
Public Interface IDifferenceBuffer _
    Inherits IDisposable, IPropertyOwner
'Usage
Dim instance As IDifferenceBuffer
public interface IDifferenceBuffer : IDisposable, 
    IPropertyOwner
public interface class IDifferenceBuffer : IDisposable, 
    IPropertyOwner
type IDifferenceBuffer =  
    interface
        interface IDisposable
        interface IPropertyOwner
    end
public interface IDifferenceBuffer extends IDisposable, IPropertyOwner

The IDifferenceBuffer type exposes the following members.

Properties

  Name Description
Public property CurrentSnapshotDifference The currently-used snapshot difference that matches up with the current snapshot of TopLevelBuffer.
Public property CurrentTopLevelSnapshot The snapshot of TopLevelBuffer that corresponds to the state at which CurrentSnapshotDifference is current.
Public property DifferenceOptions Used to get or set the options used in differencing the two buffers.
Public property LeftBuffer The left buffer in the difference.
Public property Options Used to get or set general difference buffer options (DifferenceBufferOptions).
Public property Properties (Inherited from IPropertyOwner.)
Public property RightBuffer The right buffer in the difference.
Public property TopLevelBuffer The top-level buffer, which contains the differences combined.

Top

Methods

  Name Description
Public method AddCustomIgnoreDifferencePredicate Add a custom predicate to selectively ignore differences.
Public method AddSnapshotLineFilter Add a custom SnapshotLineFilter, which can modify lines of text before they are compared.
Public method ComputeApproximateSourceLinesForPoint Get the approximate line numbers in the left and right buffers for the given point in the top buffer.
Public method ComputeApproximateTopLevelLineForPoint Get the approximate line number in the top-level buffer for the given point in the left or right buffer.
Public method Dispose (Inherited from IDisposable.)
Public method FindLineDifferences(SnapshotPoint) Find differences around the given point.
Public method FindLineDifferences(SnapshotPoint, Boolean) Find differences around the given point, optionally including "empty" differences.
Public method FindNextLineDifference(SnapshotPoint) Given a point that maps to the difference buffer or either the left or right buffer, find the next Difference or null if there is none to be found. If the given point is inside a line difference, finds the next one.
Public method FindNextLineDifference(SnapshotPoint, Predicate< (Of < <' (Difference> ) > > )) Given a point that maps to the difference buffer or either the left or right buffer, find the next Difference that matches the given predicate, or null if there is none to be found. If the given point is inside a line difference, finds the next one.
Public method FindPreviousLineDifference(SnapshotPoint) Given a point that maps to the difference buffer or either the left or right buffer, find the previous Difference or null if there is none to be found. If the given point is inside a line difference, finds the previous one.
Public method FindPreviousLineDifference(SnapshotPoint, Predicate< (Of < <' (Difference> ) > > )) Given a point that maps to the difference buffer or either the left or right buffer, find the previous Difference that matches the given predicate, or null if there is none to be found. If the given point is inside a line difference, finds the next one.
Public method GetLineType Given a point that maps to the difference buffer or either the left or right buffer, find the type of its containing line.
Public method MapToDifferenceBuffer(Difference) Given a line difference, find the associated SnapshotSpan in the difference buffer.
Public method MapToDifferenceBuffer(Match) Given a line match, find the associated SnapshotSpan in the difference buffer.
Public method MapToDifferenceBuffer(SnapshotPoint) Given a point that maps to either the LeftBuffer or RightBuffer, map that point up to the difference buffer.
Public method PerformActionWithLeftBufferWritable Perform the given edit action on the left buffer. Normally, the left buffer is kept read-only, but this method temporarily removes that protection.
Public method RemoveCustomIgnoreDifferencePredicate Remove a custom predicate previously added with <see cref="M:Microsoft.VisualStudio.Data.Tools.Delta.IDifferenceBuffer.AddCustomIgnoreDifferencePredicate(Microsoft.VisualStudio.Data.Tools.Delta.IgnoreDifferencePredicate)" />.
Public method RemoveSnapshotLineFilter Remove a custom SnapshotLineFilter previously added with <see cref="M:Microsoft.VisualStudio.Data.Tools.Delta.IDifferenceBuffer.AddSnapshotLineFilter(Microsoft.VisualStudio.Data.Tools.Delta.SnapshotLineFilter)" />.

Top

Events

  Name Description
Public event SnapshotDifferenceChanged Raised when the CurrentSnapshotDifference and TopLevelBuffer have changed.
Public event SnapshotDifferenceChanging Raised immediately before the CurrentSnapshotDifference and TopLevelBuffer are updated.

Top

See Also

Reference

Microsoft.VisualStudio.Data.Tools.Delta Namespace