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


C# ICollection.Iterator方法代码示例

本文整理汇总了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
				]);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:15,代码来源:LocalCachedPack.cs

示例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();
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:38,代码来源:UploadPack.cs


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