Share via


Difference Class

Represents a single difference in the set of differences of two lists of elements.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Text.Differencing.Difference

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

Syntax

'Declaration
Public Class Difference
public class Difference
public ref class Difference
type Difference =  class end
public class Difference

The Difference type exposes the following members.

Constructors

  Name Description
Public method Difference Initializes a new instance of a Difference with the specified left and right spans and before and after matches.

Top

Properties

  Name Description
Public property After The match after this difference. It is nulla null reference (Nothing in Visual Basic) at the end of the sequence.
Public property Before The match before this section. It is nulla null reference (Nothing in Visual Basic) at the beginning of the sequence.
Public property DifferenceType The type of the difference (add, remove, or change).
Public property Left The left side of the difference (may be zero length).
Public property Right The right side of the difference (may be zero length).

Top

Methods

  Name Description
Public method Equals Determines whether two Difference objects are the same (have the same difference type and the same before and after matches). (Overrides Object.Equals(Object).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash code for this type. (Overrides Object.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString The string representation of this difference. (Overrides Object.ToString().)

Top

Remarks

Each difference consists of a left span and a right span, either of which may have zero length (if the operation is an add operation or a delete operation). The text before and after the difference matches.

In general, differences are non-nulla null reference (Nothing in Visual Basic). However, when the difference appears at the beginning of the lists of differences, the "before" is nulla null reference (Nothing in Visual Basic), and when the difference appears at the end of the lists, the "after" is nulla null reference (Nothing in Visual Basic).

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Text.Differencing Namespace