public static Load ( ) : ImageOutputCollection | ||
return | ImageOutputCollection |
private static void EnsureOutputsLoaded() { //DC this is a hack to make sure we can load the subMenus (which on 2nd load were causing an exception) try { foreach (IPersistableImageFormat format in imageOutputCollection) { var text = format.Menu.Text; } } catch { imageOutputCollection = null; } if (imageOutputCollection == null) { imageOutputCollection = Plugins.Load(); foreach (IPersistableImageFormat format in imageOutputCollection) { IConfigurablePlugin plugin = format as IConfigurablePlugin; if (plugin != null && plugin.Settings != null) { object settings = Configuration.Current.RetrieveSettingsForPlugin(plugin.Settings.GetType()); if (settings != null) { plugin.Settings = settings; } } } } }
private static void EnsureOutputsLoaded() { if (imageOutputCollection == null) { imageOutputCollection = Plugins.Load(); foreach (IPersistableImageFormat format in imageOutputCollection) { IConfigurablePlugin plugin = format as IConfigurablePlugin; if (plugin != null && plugin.Settings != null) { object settings = Configuration.Current.RetrieveSettingsForPlugin(plugin.Settings.GetType()); if (settings != null) { plugin.Settings = settings; } } } } }
public void An_assembly_that_contains_only_an_abstrat_implementation_of_the_IPersistableImageFormat_interface_does_not_crash_the_application() { Plugins.Load(); }