예제 #1
0
파일: Tool.cs 프로젝트: wjindra/wcf
        public static int Main(string[] args)
        {
            try
            {
                // ValidateUICulture() makes sure that this command-line tool can run on RightToLeft systems.
                ValidateUICulture();

                Options     options = Options.ParseArguments(args);
                ToolRuntime runtime = new ToolRuntime(options);
                return((int)runtime.Run());
            }
            catch (ToolArgumentException ae)
            {
                ToolConsole.WriteHeader();
                ToolConsole.WriteToolError(ae);
                return((int)ae.ExitCode);
            }
            catch (ToolRuntimeException re)
            {
                ToolConsole.WriteToolError(re);
                return((int)re.ExitCode);
            }
#pragma warning suppress 56500 // covered by FxCOP
            catch (Exception e)
            {
                if (Tool.IsFatal(e))
                {
                    throw;
                }

                ToolConsole.WriteUnexpectedError(e);
                Tool.FailFast(e.ToString());
                return((int)ToolExitCodes.Unknown); // unreachable code;
            }
        }