public bool TryAddHierarchyPlugin(string pluginPath, ListBox hierarchyListBox) { var errorString = ""; var assembly = PluginScanner.GetAssembly(pluginPath, ref errorString); if (assembly != null) { var pluginTypes = PluginScanner.GetSortedTypesList <Shape>(assembly); if (pluginTypes.Count != 0) { CurrentPlugin = new Plugin(assembly, pluginTypes); HierarchyPlugins.Add(CurrentPlugin); AddPluginTypesNameToListBox(CurrentPlugin.TypesList, hierarchyListBox); return(true); } else { MessageBox.Show("Классов, расширяющих имеющуюся иерархию фигур, не было найдено!", "Ошибка!"); return(false); } } else { MessageBox.Show(errorString, "Ошибка!"); return(false); } }
public bool TryAddSerializerPlugin(string pluginPath, CheckedListBox checkedFunctionalListBox) { var errorString = ""; var assembly = PluginScanner.GetAssembly(pluginPath, ref errorString); if (assembly != null) { var pluginTypes = PluginScanner.GetSortedTypesList <IShapeListSerializer>(assembly); if (pluginTypes.Count != 0) { CurrentPlugin = new Plugin(assembly, pluginTypes); SerializerPlugins.Add(CurrentPlugin); AddPluginTypesNameToListBox(CurrentPlugin.TypesList, checkedFunctionalListBox); return(true); } else { MessageBox.Show("Функциональных классов не было найдено!", "Ошибка!"); return(false); } } else { MessageBox.Show(errorString, "Ошибка!"); return(false); } }