Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ScriptInterpreter
- {
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void TryRuntimeCompiliationButton_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- Interpreter inter = new Interpreter();
- inter.AddAssembly("System");
- inter.AddAssembly("System.Collections.Generic");
- inter.LoadAssemblies();
- inter.LoadIOClasses(@"IOClasses.cs");
- inter.LoadMethod(@"SampleMethod.cs");
- inter.Compile();
- var input = new DummyIOClasses.InputClass(new List<double>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
- object result = inter.ExecuteMethod(input);
- DummyIOClasses.OutputClass output = result as DummyIOClasses.OutputClass;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment