Down() public method

public Down ( ) : StringBuilderInterlaced
return StringBuilderInterlaced
Esempio n. 1
0
		/// <summary>
		///     For display
		/// </summary>
		/// <returns></returns>
		internal virtual void Render(StringBuilderInterlaced sb)
		{
			sb
				.AppendInterlacedLine("new GenericQueryPart {")
				.Up()
				.AppendInterlacedLine("QueryCommand = \"{0}\",", Prefix)
				.AppendInterlacedLine("Builder = \"{0}\",", Builder != null ? Builder.GetType().Name : "{NULL}")
				.AppendInterlaced("Parameter[{0}] = ", QueryParameters.Count());
			if (QueryParameters.Any())
			{
				sb.AppendInterlacedLine("{")
					.Up();
				foreach (QueryParameter queryParameter in QueryParameters.Cast<QueryParameter>())
				{
					queryParameter.Render(sb);
					sb.AppendLine(",");
				}
				sb.Down()
					.AppendInterlacedLine("}");
			}
			else
			{
				sb.AppendLine("{}");
			}
			sb.Down()
				.AppendInterlaced("}");
			//return string.Format("{{QueryCommand = {0}, Parameter = [{1}]}}", Prefix, paraString);
		}
		internal void Render(StringBuilderInterlaced sb)
		{
			sb.AppendInterlacedLine("new IQueryContainer {")
				.Up()
				.AppendInterlacedLine("AllowParamterRenaming = {0},", AllowParamterRenaming.ToString().ToLower())
				.AppendInterlacedLine("AutoParameterCounter = {0},", AutoParameterCounter)
				.AppendInterlacedLine("QueryDebugger = ")
				.Insert(new QueryDebugger(Compile(), AccessLayer.Database).Render)
				.AppendInterlacedLine("Parts[{0}] = ", Parts.Count)
				.AppendInterlacedLine("{")
				.Up();

			foreach (GenericQueryPart genericQueryPart in Parts)
			{
				genericQueryPart.Render(sb);
				sb.AppendLine(",");
			}

			sb.Down()
				.AppendInterlacedLine("}")
				.Down()
				.AppendInterlaced("}");
		}