本文整理汇总了C#中XCore.List.GetRange方法的典型用法代码示例。如果您正苦于以下问题:C# List.GetRange方法的具体用法?C# List.GetRange怎么用?C# List.GetRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XCore.List
的用法示例。
在下文中一共展示了List.GetRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CombineSegs
/// <summary>
/// Return a list of the combined segments in the two lists, ordered by BeginOffset.
/// </summary>
/// <param name="cachedSegments"></param>
/// <param name="paraSegments"></param>
/// <returns></returns>
private List<int> CombineSegs(List<int> first, List<int> second)
{
List<int> result = new List<int>(first.Count + second.Count);
int index1 = 0;
int index2 = 0;
while (index1 < first.Count && index2 < second.Count)
{
if (first[index1] == second[index2])
{
// same segment in both...transfer
result.Add(first[index1]);
index1++;
index2++;
continue;
}
int offset1 = m_cache.GetIntProperty(first[index1], (int) CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginOffset);
int offset2 = m_cache.GetIntProperty(second[index2], (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginOffset);
if (offset1 < offset2)
{
result.Add(first[index1]);
index1++;
}
else
{
result.Add(second[index2]);
index2++;
}
}
if (index1 < first.Count)
result.AddRange(first.GetRange(index1, first.Count - index1));
else if (index2 < second.Count)
result.AddRange(second.GetRange(index2, second.Count - index2));
return result;
}