private void PluginComboBox_SelectedIndexChanged(object sender, EventArgs e) { string pluginName = PluginComboBox.GetItemText(PluginComboBox.SelectedItem); factory = plugin.GetPlugin(pluginName); creator = (ICreate)Activator.CreateInstance(factory); }
private void PluginComboBox_SelectedIndexChanged(object sender, EventArgs e) { string pluginName = PluginComboBox.GetItemText(PluginComboBox.SelectedItem); currentFactory = plugin.GetPluginType(pluginName); currentCreator = (ICreator)Activator.CreateInstance(currentFactory); currentFigure = currentCreator.Create(color, fillColor, penWidth); StateChange(currentCreator); }