private void Button_Add_Click(object sender, RoutedEventArgs e) { var dialog = new OpenFileDialog { FileName = "Library", DefaultExt = ".dll", Filter = "Library file (.dll)|*.dll" }; bool?result = dialog.ShowDialog(); if (result == true) { var filename = dialog.FileName; try { var file = new FileInfo(filename); _functionLoader.LoadFunctionsFromAssemblyPath(filename); lbLibraries.Items.Add(file.Name); UpdateFuntionList(); } catch { } } }
static void LoadAssembly(FunctionLoader loader, IEnumerable <string> assemblyList) { foreach (var assemblyPath in assemblyList) { loader.LoadFunctionsFromAssemblyPath(assemblyPath); Console.WriteLine("{0} loaded", assemblyPath); } }