using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace DynamicCompiler
{
    public class Executor
    {
        string inputAssembly;
        string instanceName;
        string methodName;
        public void Execute()
        {
            Assembly assembly = Assembly.LoadFrom(inputAssembly);
            MethodInfo mi;
            Type t = assembly.GetType(instanceName);
            object mode = assembly.CreateInstance(instanceName);
            mi = t.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public);
            mi.Invoke(mode, new object[0]); 
        }
        public Executor(string inputAssembly,string instanceName,string methodName)
        {
            this.inputAssembly = inputAssembly;
            this.instanceName = instanceName;
            this.methodName = methodName;
        }
    }
}
