private static void ExecuteProgramUnchecked(string[] args) { Dictionary <string, string> argLookup = FlagParser.Parse(args); if (argLookup.ContainsKey(FlagParser.GEN_DEFAULT_PROJ)) { DefaultProjectGenerator generator = new DefaultProjectGenerator(argLookup[FlagParser.GEN_DEFAULT_PROJ].Trim()); Dictionary <string, FileOutput> project = generator.Validate().Export(); string directory = System.IO.Path.Combine( System.IO.Directory.GetCurrentDirectory(), generator.ProjectID); new FileOutputExporter(directory).ExportFiles(project); Console.WriteLine("Empty project exported to directory '" + generator.ProjectID + "/'"); } else { Program.Compile(argLookup); } #if DEBUG if (argLookup != null) { if (argLookup.ContainsKey(FlagParser.SHOW_PERFORMANCE_MARKERS)) { string summary = PerformanceTimer.GetSummary(); Console.WriteLine(summary); } } #endif }
public override CrayonWorkerResult DoWorkImpl(CrayonWorkerResult[] args) { #if DEBUG string summary = PerformanceTimer.GetSummary(); Console.WriteLine(summary); #endif return(new CrayonWorkerResult()); }
static void Main(string[] args) { Dictionary <string, string> argLookup = null; using (new PerformanceSection("Crayon")) { #if DEBUG args = GetEffectiveArgs(args); // First chance exceptions should crash in debug builds. argLookup = FlagParser.Parse(args); Program.Compile(argLookup); // Crash if there were any graphics contexts that weren't cleaned up. // This is okay on Windows, but on OSX this is a problem, so ensure that a // regressions are quickly noticed. SystemBitmap.Graphics.EnsureCleanedUp(); #else if (args.Length == 0) { System.Console.WriteLine(USAGE); } else { try { argLookup = FlagParser.Parse(args); Program.Compile(argLookup); } catch (InvalidOperationException e) { System.Console.Error.WriteLine(e.Message); } catch (ParserException e) { System.Console.Error.WriteLine(e.Message); } } #endif } #if DEBUG if (argLookup != null) { if (argLookup.ContainsKey(FlagParser.SHOW_PERFORMANCE_MARKERS)) { string summary = PerformanceTimer.GetSummary(); Console.WriteLine(summary); } } #endif }