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 | |
---|---|---|
BaseLeftBuffer | Gets or sets the source of the left buffer in the difference. | |
BaseRightBuffer | Gets or sets the source of the right buffer in the difference. | |
CurrentInlineBufferSnapshot | Gets or sets the snapshot of the InlineBuffer that corresponds to the state at which CurrentSnapshotDifference is current. | |
CurrentSnapshotDifference | Gets or sets the currently-used snapshot difference that matches up with the current snapshot of the InlineBuffer. | |
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. | |
InlineBuffer | Gets or sets the top-level buffer, which contains the differences combined. | |
IsEditingDisabled | Determines whether editing is disabled in this IDifferenceBuffer. | |
LeftBuffer | Gets or sets the left buffer of the difference. | |
Options | Gets or sets the general difference buffer options DifferenceBufferOptions). | |
Properties | Gets the collection of properties controlled by the property owner. (Inherited from IPropertyOwner.) | |
RightBuffer | Gets or sets the right buffer in the difference. |
Top
Methods
Name | Description | |
---|---|---|
AddIgnoreDifferencePredicate | Add a predicate to selectively ignore differences. | |
AddSnapshotLineTransform | Add a custom SnapshotLineTransform, which can modify lines of text before they are compared. | |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) | |
RemoveIgnoreDifferencePredicate | Remove a predicate previously added with AddIgnoreDifferencePredicate. | |
RemoveSnapshotLineTransform | Remove a custom SnapshotLineTransform previously added with AddSnapshotLineTransform |
Top
Events
Name | Description | |
---|---|---|
SnapshotDifferenceChanged | Occurs when the CurrentSnapshotDifference and InlineBuffer have changed. | |
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.