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


C# IIterator.IsDone方法代码示例

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


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

示例1: PrintUsers

 private static void PrintUsers(IIterator iterate)
 {
     while (!iterate.IsDone())
     {
         Console.WriteLine(iterate.Next());
     }
 }
开发者ID:muriloxk,项目名称:csharp-designpatterns-estudo,代码行数:7,代码来源:Program.cs

示例2: printMember

 public void printMember(IIterator iterate)
 {
     iterate.First();
     while (!iterate.IsDone())
     {
         //textBox.AppendText("Friend");
     }
 }
开发者ID:userWayneCampbell,项目名称:Design-Patterns-ONU,代码行数:8,代码来源:Form1.cs

示例3: PrintUsers

 public static void PrintUsers(IIterator iterate)
 {
     iterate.First();
     while (!iterate.IsDone())
     {
         Console.WriteLine(iterate.Next());
     }
 }
开发者ID:Karenzuniga,项目名称:pddcsharp,代码行数:8,代码来源:Program.cs

示例4: CreatePreviewImage

		Image CreatePreviewImage(string s)
		{
			int height = 80;
			int width = 530;
			int lineLength = 18;
			int diameter = 30;
			int leftSpan = 3;
			int topSpan = 20;


			IIterator circleNodeIterator;//用于输出结点链表的指针
			IIterator lineNodeIterator;//用于输出连接线链表的指针

			LinkCircleNode headNode = null;
			LinkLineNode   headLineNode = null;
			LinkCircleNode previousNode = null;
			LinkLineNode   previousLineNode = null;
			LinkCircleNode currentNode = null;
			LinkLineNode   currentLineNode = null;
			previousNode = headNode = new LinkCircleNode(leftSpan,topSpan,diameter,Color.Red,"H");
			previousLineNode = headLineNode = new LinkLineNode(leftSpan + diameter,topSpan + diameter/2,leftSpan + diameter + lineLength,topSpan + diameter/2,lineWidth,Color.Red);

			for(int i = 0;i < s.Length;i++)
			{
				currentNode = new LinkCircleNode(leftSpan + (i + 1) * (lineLength + diameter),topSpan,diameter,Color.DarkTurquoise,s[i].ToString());
				currentLineNode = new LinkLineNode(leftSpan + diameter + (i + 1) * (lineLength + diameter),topSpan + diameter/2,leftSpan + diameter + (i + 1) * (lineLength + diameter) + lineLength,topSpan + diameter/2,lineWidth,Color.Red);
				
				previousNode.Next = currentNode;
				previousLineNode.Next = currentLineNode;

				previousNode = currentNode;
				previousLineNode = currentLineNode;

			}

			if(currentNode != null)
			{
				currentNode.Next = null;
				currentLineNode.Next = null;
			}
			circleNodeIterator = headNode.CreateIterator(); 
			lineNodeIterator = headLineNode.CreateIterator();

			Bitmap bmp = new Bitmap(width,height);
			Graphics g = Graphics.FromImage(bmp);

			if(circleNodeIterator != null)
			{
				for(IIterator iterator = circleNodeIterator.First();!circleNodeIterator.IsDone();iterator = circleNodeIterator.Next())
				{
					iterator.CurrentItem.Draw(g);
				}
			}
			if(lineNodeIterator != null)
			{
				for(IIterator iterator = lineNodeIterator.First();!lineNodeIterator.IsDone();iterator = lineNodeIterator.Next())
				{
					iterator.CurrentItem.Draw(g);
				}
			}

			return bmp;

		}
开发者ID:tangxuehua,项目名称:DataStructure,代码行数:64,代码来源:CreateList.cs


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