コード例 #1
0
        public static BatchOperation Parse(Solution solution, string input)
        {
            var operation = new BatchOperation(solution);

            input.ReadLines(line =>
            {
                if (line.IsEmpty())
                {
                    return;
                }

                var tokens = line.Split(':');
                if (tokens.Length == 1)
                {
                    RippleAssert.Fail("expected \":\" - {0}", line);
                }
                else if (tokens.Length != 2)
                {
                    RippleAssert.Fail("unexpected \":\" - {0}", line);
                }

                var requests = parseLine(solution, tokens);
                operation._requests.AddRange(requests);
            });

            return(operation);
        }
コード例 #2
0
ファイル: BatchOperation.cs プロジェクト: modulexcite/ripple
		public static BatchOperation Parse(Solution solution, string input)
		{
			var operation = new BatchOperation(solution);
			input.ReadLines(line =>
			{
				if (line.IsEmpty()) return;

				var tokens = line.Split(':');
				if (tokens.Length == 1)
				{
					RippleAssert.Fail("expected \":\" - {0}", line);
				}
				else if (tokens.Length != 2)
				{
					RippleAssert.Fail("unexpected \":\" - {0}", line);
				}

				var requests = parseLine(solution, tokens);
				operation._requests.AddRange(requests);
			});

			return operation;
		}