public static int Main(string[] args)
{
//Debugger.Break();
LocBamlOptions options;
string errorMessage;
GetCommandLineOptions(args, out options, out errorMessage);
if (errorMessage != null)
{
// there are errors
PrintLogo(options);
Console.WriteLine(StringLoader.Get("ErrorMessage", errorMessage));
Console.WriteLine();
PrintUsage();
return ErrorCode; // error
}
// at this point, we obtain good options.
if (options == null)
{
// no option to process. Noop.
return SuccessCode;
}
_dispatcher = Dispatcher.CurrentDispatcher;
PrintLogo(options);
try{
// it is to parse
if (options.ToParse)
{
ParseBamlResources(options);
}
else
{
GenerateBamlResources(options);
}
}
catch(Exception e)
{
#if DEBUG
throw e;
#else
Console.WriteLine(e.Message);
return ErrorCode;
#endif
}
return SuccessCode;
}