Match 类

将两个序列之间的匹配范围表示为长度相等的范围对。

继承层次结构

Object
  Microsoft.VisualStudio.Text.Differencing.Match

命名空间:  Microsoft.VisualStudio.Text.Differencing
程序集:  Microsoft.VisualStudio.Text.Data(在 Microsoft.VisualStudio.Text.Data.dll 中)

语法

声明
Public Class Match _
    Implements IEnumerable(Of Tuple(Of Integer, Integer)),  _
    IEnumerable
public class Match : IEnumerable<Tuple<int, int>>, 
    IEnumerable
public ref class Match : IEnumerable<Tuple<int, int>^>, 
    IEnumerable
type Match =  
    class 
        interface IEnumerable<Tuple<int, int>>
        interface IEnumerable 
    end
public class Match implements IEnumerable<Tuple<int, int>>, IEnumerable

Match 类型公开以下成员。

构造函数

  名称 说明
公共方法 Match 用两个长度相等的范围创建匹配。

页首

属性

  名称 说明
公共属性 Left 获取左侧范围
公共属性 Length 获取范围的长度。两个范围的长度相等。
公共属性 Right 获取右侧范围。

页首

方法

  名称 说明
公共方法 Equals 确定两个 Match 对象是否具有相同的左侧和右侧范围。 (重写 Object.Equals(Object)。)
受保护的方法 Finalize 在垃圾回收将某一对象回收前允许该对象尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetEnumerator 获取类型化为整数 Tuple 的枚举器。
公共方法 GetHashCode 提供一个哈希函数。 (重写 Object.GetHashCode。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

显式接口实现

  名称 说明
显式接口实现私有方法 IEnumerable.GetEnumerator 获取未类型化的枚举器。

页首

备注

将两个字符序列:

abCCd ()

abFFd (正确)

生成对它是:

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

这将成为两个 match (左侧开始、正确开始,长度):

(0, 0, 2) 和 (4, 4, 1)。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.VisualStudio.Text.Differencing 命名空间