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


C# System.Collections.Generic.List.MoveNext方法代码示例

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


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

示例1: ChildNavigator

		public ChildNavigator(IDataViewStrategy dataStore,IndexList indexList)
		{
			if (dataStore == null) {
				throw new ArgumentNullException("dataStore");
			}
			this.store = dataStore;
			this.indexList = indexList;
			genEnumerator = this.indexList.GetEnumerator();
			genEnumerator.MoveNext();
		}
开发者ID:ootsby,项目名称:SharpDevelop,代码行数:10,代码来源:ChildNavigator.cs

示例2: ConvertPosix2DotNetExpr

		/// <summary>
		/// Converts POSIX regular expression to .NET Framework regular expression
		/// </summary>
		/// <param name="expr">POSIX 1003.2 regular expression</param>
		/// <returns>.NET Framework compatible regular expression</returns>
		// WORKING: change to private!
		public static string ConvertPosix2DotNetExpr(string expr)
		{
			if (expr == null) return "";

			// number that is not used in automaton
			const int errorState = 99;

			// 0 == initial state
			int state = 0;

			// iterator for iterating in strings
#if !SILVERLIGHT
			CharEnumerator ch = expr.GetEnumerator();
#else
            System.Collections.Generic.IEnumerator<char> ch = new System.Collections.Generic.List<char>(expr.ToCharArray()).GetEnumerator();
#endif
			// true if we are at the end of bracket expression
			bool eOfExpr = false;

			// true if we have read next character and this character is not applicable for current state,
			// we change state with lambda step and there is character scanned again
			// true if we are changing state and the character should be scanned again
			bool lambdaStep = false;

			// into this StringBuilder is converted regular expression written
			// 2*expr.Length is estimated necessary length of output string
			StringBuilder output = new StringBuilder(2 * expr.Length);

			// bracket expressions are very complicated, we have made separate class for managing them
			// if we need to create bracket expression class instance, we store it in this variable
			// and reuse it after Reset() call
			BracketExpression be = null;



			eOfExpr = !ch.MoveNext();
			while (!eOfExpr)
			{
				switch (state)
				{
					case 0: // initial state
						switch (ch.Current)
						{
							case '\\':
								state = 1;
								break;

							case '[':
								state = 2;
								if (be != null) // bracket expr. already exists, reset it only
									be.Reset();
								else
									be = new BracketExpression();
								break;

							case '(':
								state = 15;
								break;

							default:
								output.Append(ch.Current);
								break;
						}
						break;

					case 1:
						if (controlCharsMap.Contains(ch.Current))
						{	// control character - must be preppended by '\'
							output.Append('\\');
						}

						output.Append(ch.Current);
						state = 0;
						break;

					case 2:
						switch (ch.Current)
						{
							case '^':
								be.Negation = true;
								state = 3;
								break;

							case ']':
								be.Append(']');
								state = 4;
								break;

							default:
								lambdaStep = true;
								state = 4;
								break;
						}
						break;
//.........这里部分代码省略.........
开发者ID:hansdude,项目名称:Phalanger,代码行数:101,代码来源:RegExpPosix.cs


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