Export (0) Print
Expand All

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)

public interface IDifferenceBuffer : IDisposable, 
	IPropertyOwner

The IDifferenceBuffer type exposes the following members.

  NameDescription
Public propertyBaseLeftBufferGets or sets the source of the left buffer in the difference.
Public propertyBaseRightBufferGets or sets the source of the right buffer in the difference.
Public propertyCurrentInlineBufferSnapshotGets or sets the snapshot of the InlineBuffer that corresponds to the state at which CurrentSnapshotDifference is current.
Public propertyCurrentSnapshotDifferenceGets or sets the currently-used snapshot difference that matches up with the current snapshot of the InlineBuffer.
Public propertyDifferenceOptionsGets 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 propertyInlineBufferGets or sets the top-level buffer, which contains the differences combined.
Public propertyIsEditingDisabledDetermines whether editing is disabled in this IDifferenceBuffer.
Public propertyLeftBufferGets or sets the left buffer of the difference.
Public propertyOptionsGets or sets the general difference buffer options DifferenceBufferOptions).
Public propertyPropertiesGets the collection of properties controlled by the property owner. (Inherited from IPropertyOwner.)
Public propertyRightBufferGets or sets the right buffer in the difference.
Top

  NameDescription
Public methodAddIgnoreDifferencePredicateAdd a predicate to selectively ignore differences.
Public methodAddSnapshotLineTransformAdd a custom SnapshotLineTransform, which can modify lines of text before they are compared.
Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public methodRemoveIgnoreDifferencePredicateRemove a predicate previously added with AddIgnoreDifferencePredicate.
Public methodRemoveSnapshotLineTransformRemove a custom SnapshotLineTransform previously added with AddSnapshotLineTransform
Top

  NameDescription
Public eventSnapshotDifferenceChangedOccurs when the CurrentSnapshotDifference and InlineBuffer have changed.
Public eventSnapshotDifferenceChangingOccurs immediately before the CurrentSnapshotDifference and InlineBuffer are updated.
Top

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.

Show:
© 2014 Microsoft