static void Main(string[] args)
        {
            ts.TraceInformation("{0} version {1} by {2}", Application.ProductName, Application.ProductVersion, Application.CompanyName);

            Application.EnableVisualStyles();



            var gui = new StateBuilderGui();

            gui.ParseArgs(args);

            if (gui.options.batchMode == true)
            {
                gui.errorCode = gui.Generate();
            }
            else
            {
                gui.UpdateGuiFromOption();
                Application.Run(gui);
            }

            System.Diagnostics.Debug.Flush();
            Environment.Exit((int)gui.errorCode);
        }
        static void Main(string[] args)
        {
            ts.TraceInformation("{0} version {1} by {2}", Application.ProductName, Application.ProductVersion, Application.CompanyName);

            Application.EnableVisualStyles();



            var gui = new StateBuilderGui();

            if (args.Length > 0)
            {
                foreach (var a in args)
                {
                    if (File.Exists(a))
                    {
                        autoGen = true;
                        gui.CurrentFsmFileName = Path.GetFullPath(a);
                    }
                }
            }

            gui.ParseArgs(args);

            if (gui.options.batchMode == true || autoGen)
            {
                gui.errorCode = gui.Generate();
            }
            else
            {
                gui.UpdateGuiFromOption();
                Application.Run(gui);
            }

            System.Diagnostics.Debug.Flush();
            Environment.Exit((int)gui.errorCode);
        }