Compartilhar via


IDifferenceBuffer Interface

Definition

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

public interface class IDifferenceBuffer : IDisposable, Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface IDifferenceBuffer : IDisposable, Microsoft.VisualStudio.Utilities.IPropertyOwner
type IDifferenceBuffer = interface
    interface IDisposable
    interface IPropertyOwner
Public Interface IDifferenceBuffer
Implements IDisposable, IPropertyOwner
Derived
Implements

Remarks

The differences are computed on a background thread in response to various changes (text change, options changing, etc.), though all of the events around differencing, like SnapshotDifferenceChanged, will be raised on the thread that owns the LeftBuffer and RightBuffer (generally, the UI thread).

Because the differences are computed asynchronously, the CurrentSnapshotDifference may be behind the current versions of any of the buffers, and will be null before the first difference is computed.

Properties

BaseLeftBuffer

The source of the left buffer in the difference.

BaseRightBuffer

The source of the right buffer in the difference.

CurrentInlineBufferSnapshot

The snapshot of InlineBuffer that corresponds to the state at which CurrentSnapshotDifference is current.

CurrentSnapshotDifference

The currently-used snapshot difference that matches up with the current snapshot of InlineBuffer.

DifferenceOptions

Used to get or set the options used in differencing the two buffers. These options are used in calls to the IHierarchicalStringDifferenceService that performs the actual comparison.

InlineBuffer

The top-level buffer, which contains the differences combined.

IsEditingDisabled

Is editing disabled in this IDifferenceBuffer?

LeftBuffer

The left buffer of the difference.

Options

Used to modify general difference buffer options (DifferenceBufferOptions).

Properties

The collection of properties controlled by the property owner.

(Inherited from IPropertyOwner)
RightBuffer

The right buffer in the difference.

Methods

AddIgnoreDifferencePredicate(IgnoreDifferencePredicate)

Add a predicate to selectively ignore differences.

AddSnapshotLineTransform(SnapshotLineTransform)

Add a custom SnapshotLineTransform, which can modify lines of text before they are compared.

RemoveIgnoreDifferencePredicate(IgnoreDifferencePredicate)

Remove a predicate previously added with AddIgnoreDifferencePredicate(IgnoreDifferencePredicate).

RemoveSnapshotLineTransform(SnapshotLineTransform)

Remove a custom SnapshotLineTransform previously added with AddSnapshotLineTransform(SnapshotLineTransform).

Events

SnapshotDifferenceChanged

Raised when the CurrentSnapshotDifference and InlineBuffer have changed.

SnapshotDifferenceChanging

Raised immediately before the CurrentSnapshotDifference and InlineBuffer are updated.

Applies to