CCNet.Build.Common.Execute.ReportArguments C# (CSharp) Method

ReportArguments() public static method

Reports known arguments and their current values, if requested.
public static ReportArguments ( Type argsType, bool displayValues ) : void
argsType System.Type
displayValues bool
return void
		public static void ReportArguments(Type argsType, bool displayValues)
		{
			if (argsType == null)
				return;

			var props = argsType.GetProperties(BindingFlags.Public | BindingFlags.Static)
				.Where(pi => pi.PropertyType != typeof(ArgumentProperties))
				.OrderBy(pi => pi.Name)
				.ToList();

			if (props.Count > 0)
			{
				Console.WriteLine();
				Console.WriteLine("Arguments:");

				foreach (var prop in props)
				{
					var name = prop.Name;
					Console.WriteLine("\t{0}", name);

					if (displayValues)
					{
						var value = prop.GetValue(null);
						Console.WriteLine("\t\t{0}", value);
					}
				}
			}
		}