Ejemplo n.º 1
0
        private static int Execute(Assembly assembly, IMethodSymbol entryPoint, string[] scriptArguments)
        {
            object[] arguments;

            if (entryPoint.Parameters.Length == 0)
            {
                arguments = SpecializedCollections.EmptyObjects;
            }
            else
            {
                Debug.Assert(entryPoint.Parameters.Length == 1);
                arguments = new object[] { scriptArguments };
            }

            var rtEntryPoint = ScriptBuilder.GetEntryPointRuntimeMethod(entryPoint, assembly, default(CancellationToken));

            object result = rtEntryPoint.Invoke(null, arguments);

            return(result is int?(int)result : CommonCompiler.Succeeded);
        }