Compartilhar via


IDifferenceBuffer Interface

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

Namespace:  Microsoft.VisualStudio.Text.Differencing
Assembly:  Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)

Syntax

'Declaration
Public Interface IDifferenceBuffer _
    Inherits IDisposable, IPropertyOwner
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 BaseLeftBuffer Gets or sets the source of the left buffer in the difference.
Public property BaseRightBuffer Gets or sets the source of the right buffer in the difference.
Public property CurrentInlineBufferSnapshot Gets or sets the snapshot of the InlineBuffer that corresponds to the state at which CurrentSnapshotDifference is current.
Public property CurrentSnapshotDifference Gets or sets the currently-used snapshot difference that matches up with the current snapshot of the InlineBuffer.
Public property DifferenceOptions Gets or sets the options used in differencing the two buffers. These options are used in calls to the IHierarchicalStringDifferenceService that performs the actual comparison.
Public property InlineBuffer Gets or sets the top-level buffer, which contains the differences combined.
Public property IsEditingDisabled Determines whether editing is disabled in this IDifferenceBuffer.
Public property LeftBuffer Gets or sets the left buffer of the difference.
Public property Options Gets or sets the general difference buffer options DifferenceBufferOptions).
Public property Properties Gets the collection of properties controlled by the property owner. (Inherited from IPropertyOwner.)
Public property RightBuffer Gets or sets the right buffer in the difference.

Top

Methods

  Name Description
Public method AddIgnoreDifferencePredicate Add a predicate to selectively ignore differences.
Public method AddSnapshotLineTransform Add a custom SnapshotLineTransform, which can modify lines of text before they are compared.
Public method Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public method RemoveIgnoreDifferencePredicate Remove a predicate previously added with AddIgnoreDifferencePredicate.
Public method RemoveSnapshotLineTransform Remove a custom SnapshotLineTransform previously added with AddSnapshotLineTransform

Top

Events

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

Top

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.

See Also

Reference

Microsoft.VisualStudio.Text.Differencing Namespace