コード例 #1
0
		public IMultiRenameElement VisitTree()
		{
			MultiRenameElementCollection result = new MultiRenameElementCollection();

			var child = _tree.child_;
			int startLiteral = 0;

			while (null != child)
			{
				int startChild = child.match_.posBeg_;
				if (startChild > startLiteral)
				{
					result.Elements.Add(new MultiRenameLiteralElement(_sourceText.Substring(startLiteral, startChild - startLiteral)));
				}
				startLiteral = child.match_.posEnd_;

				switch (child.id_)
				{
					case (int)EAltaxo_MultiRename.EscBracket:
						result.Elements.Add(HandleEscBracket(child));
						break;

					case (int)EAltaxo_MultiRename.IntegerTemplate:
						result.Elements.Add(HandleIntegerTemplate(child));
						break;

					case (int)EAltaxo_MultiRename.StringTemplate:
						result.Elements.Add(HandleStringTemplate(child));
						break;

					case (int)EAltaxo_MultiRename.DateTimeTemplate:
						result.Elements.Add(HandleDateTimeTemplate(child));
						break;

					case (int)EAltaxo_MultiRename.ArrayTemplate:
						result.Elements.Add(HandleArrayTemplate(child));
						break;
				}

				child = child.next_;
			}

			if (_sourceText.Length > startLiteral)
				result.Elements.Add(new MultiRenameLiteralElement(_sourceText.Substring(startLiteral, _sourceText.Length - startLiteral)));

			return result;
		}