当前位置: 首页>>代码示例>>C#>>正文


C# SourceRange.Overlap方法代码示例

本文整理汇总了C#中SourceRange.Overlap方法的典型用法代码示例。如果您正苦于以下问题:C# SourceRange.Overlap方法的具体用法?C# SourceRange.Overlap怎么用?C# SourceRange.Overlap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SourceRange的用法示例。


在下文中一共展示了SourceRange.Overlap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestOverlaps

 public void TestOverlaps()
 {
     SourcePosition loc1 = new SourcePosition(0, 1, 1);
     SourcePosition loc2 = new SourcePosition(2, 1, 3);
     SourcePosition loc3 = new SourcePosition(5, 1, 6);
     SourcePosition loc4 = new SourcePosition(6, 1, 7);
     SourcePosition loc5 = new SourcePosition(9, 2, 14);
     SourceRange range1 = new SourceRange(loc2, loc4);
     SourceRange range2 = new SourceRange(loc1, loc1);
     SourceRange range3 = new SourceRange(loc1, loc2);
     SourceRange range4 = new SourceRange(loc1, loc3);
     SourceRange range5 = new SourceRange(loc1, loc4);
     SourceRange range6 = new SourceRange(loc1, loc5);
     SourceRange range7 = new SourceRange(loc2, loc2);
     SourceRange range8 = new SourceRange(loc3, loc3);
     Assert.AreEqual(false, SourceRange.Unknown.OverlapsWith(SourceRange.Unknown));
     Assert.AreEqual(SourceRange.Unknown, SourceRange.Unknown.Overlap(SourceRange.Unknown));
     Assert.AreEqual(false, range1.OverlapsWith(SourceRange.Unknown));
     Assert.AreEqual(SourceRange.Unknown, range1.Overlap(SourceRange.Unknown));
     Assert.AreEqual(false, range1.OverlapsWith(range2));
     Assert.AreEqual(SourceRange.Unknown, range1.Overlap(range2));
     Assert.AreEqual(true, range1.OverlapsWith(range3));
     Assert.AreEqual(new SourceRange(loc2), range1.Overlap(range3));
     Assert.AreEqual(true, range1.OverlapsWith(range4));
     Assert.AreEqual(new SourceRange(loc2, loc3), range1.Overlap(range4));
     Assert.AreEqual(true, range1.OverlapsWith(range5));
     Assert.AreEqual(range1, range1.Overlap(range5));
     Assert.AreEqual(true, range1.OverlapsWith(range6));
     Assert.AreEqual(range1, range1.Overlap(range6));
     Assert.AreEqual(true, range1.OverlapsWith(range7));
     Assert.AreEqual(range7, range1.Overlap(range7));
     Assert.AreEqual(true, range1.OverlapsWith(range8));
     Assert.AreEqual(range8, range1.Overlap(range8));
 }
开发者ID:GISwilson,项目名称:Cyjb,代码行数:34,代码来源:UnitTestSourceRange.cs


注:本文中的SourceRange.Overlap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。