Partilhar via


Match Class

Represents a range of matches between two sequences as a pair of spans of equal length.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Text.Differencing.Match

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

Syntax

'Declaração
Public Class Match _
    Implements IEnumerable(Of Tuple), IEnumerable
public class Match : IEnumerable<Tuple>, 
    IEnumerable
public ref class Match : IEnumerable<Tuple^>, 
    IEnumerable
type Match =  
    class
        interface IEnumerable<Tuple>
        interface IEnumerable
    end
public class Match implements IEnumerable<Tuple>, IEnumerable

The Match type exposes the following members.

Constructors

  Name Description
Public method Match Creates a match from two spans of equal length.

Top

Properties

  Name Description
Public property Left Get the left-side range
Public property Length Gets the length of the spans. Both spans have equal lengths.
Public property Right Gets the right span.

Top

Methods

  Name Description
Public method Equals Determines whether two Match objects have the same left and right spans. (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 GetEnumerator Gets an enumerator typed as a Tuple<T1, T2> of integers.
Public method GetHashCode Provides a hash function. (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 Returns a string that represents the current object. (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Gets an untyped enumerator.

Top

Remarks

Given two sequences of characters:

abCCd (left)

abFFd (right)

The generated pairs of matches would be:

(0, 0), (1, 1), (4, 4)

This becomes the two Matches (left-start, right-start, length):

(0, 0, 2) and (4, 4, 1).

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