public ActionResult DrawStackTraceArt(string stackTraceArtClassWrapperTypeFullName) { var stackTraceArtClassWrapperType = StackTraceArtClassWrapperHelper .FindStackTraceArtClassWrappersInDirectory(new DirectoryInfo(Server.MapPath("~/bin"))) .Single(type => type.FullName == stackTraceArtClassWrapperTypeFullName); StackTraceArtClassWrapperHelper.Paint(stackTraceArtClassWrapperType); return(null); // This will never happen because the above method throws the Stack Trace Art exception. }
static void Main() { var stackTraceArtClassWrappers = StackTraceArtClassWrapperHelper.FindStackTraceArtClassWrappersInDirectory(new DirectoryInfo(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) ?? string.Empty /* To silent ReSharper.*/)); for (int i = 0; i < stackTraceArtClassWrappers.Length; i++) { Console.WriteLine("{0}. {1}", i + 1, stackTraceArtClassWrappers[i].Name); } Console.Write("Select art: "); int artIndex = int.Parse(Console.ReadLine() ?? "1") - 1; StackTraceArtClassWrapperHelper.Paint(stackTraceArtClassWrappers[artIndex]); }