本文整理汇总了C#中ICollection.Iterator方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.Iterator方法的具体用法?C# ICollection.Iterator怎么用?C# ICollection.Iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICollection
的用法示例。
在下文中一共展示了ICollection.Iterator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LocalCachedPack
internal LocalCachedPack(ObjectDirectory odb, ICollection<ObjectId> tips, IList<string
> packNames)
{
this.odb = odb;
if (tips.Count == 1)
{
this.tips = Sharpen.Collections.Singleton(tips.Iterator().Next());
}
else
{
this.tips = Sharpen.Collections.UnmodifiableSet(tips);
}
this.packNames = Sharpen.Collections.ToArray(packNames, new string[packNames.Count
]);
}
示例2: CheckNotAdvertisedWants
/// <exception cref="NGit.Errors.MissingObjectException"></exception>
/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
/// <exception cref="System.IO.IOException"></exception>
private void CheckNotAdvertisedWants(ICollection<RevObject> notAdvertisedWants)
{
// Walk the requested commits back to the advertised commits.
// If any commit exists, a branch was deleted or rewound and
// the repository owner no longer exports that requested item.
// If the requested commit is merged into an advertised branch
// it will be marked UNINTERESTING and no commits return.
foreach (RevObject o in notAdvertisedWants)
{
if (!(o is RevCommit))
{
throw new PackProtocolException(MessageFormat.Format(JGitText.Get().wantNotValid,
notAdvertisedWants.Iterator().Next().Name));
}
walk.MarkStart((RevCommit)o);
}
foreach (ObjectId id in advertised)
{
try
{
walk.MarkUninteresting(walk.ParseCommit(id));
}
catch (IncorrectObjectTypeException)
{
continue;
}
}
RevCommit bad = walk.Next();
if (bad != null)
{
throw new PackProtocolException(MessageFormat.Format(JGitText.Get().wantNotValid,
bad.Name));
}
walk.Reset();
}