private static int Main(string[] args) { var parsedArguments = new ToolArguments(); if (!CommandLineUtility.ParseCommandLineArguments(args, parsedArguments) || !parsedArguments.IsValid()) { Console.Write(CommandLineUtility.CommandLineArgumentsUsage(typeof(ToolArguments))); return(-1); } try { AssemblyResolvePath = parsedArguments.AssemblyResolvePath; AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveHandler); Tool.Run(parsedArguments); } catch (Exception e) { Console.Error.WriteLine(e); return(-1); } return(0); }
public static void Run(ToolArguments arguments) { // create tool context var context = new ToolContext { Arguments = arguments }; // process the arguments ProcessArguments(context); // process the input ProcessInput(context); // generate the output GenerateOutput(context); }