Пример #1
0
        int Execute()
        {
            var arguments  = BuildArgumentArray();
            var in_process = InProcess && Profile != Profile.macOSClassic;

            if (in_process)
            {
                int rv;
                var previous_environment = new Dictionary <string, string> ();
                foreach (var kvp in EnvironmentVariables)
                {
                    previous_environment [kvp.Key] = Environment.GetEnvironmentVariable(kvp.Key);
                    Environment.SetEnvironmentVariable(kvp.Key, kvp.Value);
                }
                ThreadStaticTextWriter.ReplaceConsole(Output);
                try {
                    rv = BindingTouch.Main(arguments);
                } finally {
                    ThreadStaticTextWriter.RestoreConsole();
                    foreach (var kvp in previous_environment)
                    {
                        Environment.SetEnvironmentVariable(kvp.Key, kvp.Value);
                    }
                }
                Console.WriteLine(Output);
                ParseMessages();
                return(rv);
            }
            return(Execute(arguments, always_show_output: true));
        }
Пример #2
0
        int Execute()
        {
            var arguments  = BuildArgumentArray();
            var in_process = InProcess && Profile != Profile.macOSClassic;

            if (in_process)
            {
                int rv;
                ThreadStaticTextWriter.ReplaceConsole(Output);
                try {
                    rv = BindingTouch.Main(arguments);
                } finally {
                    ThreadStaticTextWriter.RestoreConsole();
                }
                Console.WriteLine(Output);
                ParseMessages();
                return(rv);
            }
            return(Execute(string.Join(" ", StringUtils.Quote(arguments)), always_show_output: true));
        }