47
47
const string DefaultPluginIcon = "folder_tar";
49
static IEnumerable<string> ExtensionPaths = new [] { "/Do/ItemSource", "/Do/Action" };
49
static IEnumerable<string> ExtensionPaths = new [] { "/Do/ItemSource", "/Do/Action", "/Do/DynamicItemSource" };
51
51
public static readonly IEnumerable<AddinClassifier> Classifiers =
52
52
new AddinClassifier [] {
204
204
get { return AddinManager.GetExtensionObjects ("/Do/ItemSource").OfType<ItemSource> (); }
208
/// All loaded DynamicItemSources.
210
public static IEnumerable<DynamicItemSource> DynamicItemSources {
211
get { return AddinManager.GetExtensionObjects ("/Do/DynamicItemSource").OfType<DynamicItemSource> (); }
208
215
/// All loaded Actions.
276
283
static void OnPluginChanged (object sender, ExtensionNodeEventArgs args)
278
285
TypeExtensionNode node = args.ExtensionNode as TypeExtensionNode;
280
287
switch (args.Change) {
281
case ExtensionChange.Add:
283
object plugin = node.GetInstance ();
284
Log<PluginManager>.Debug ("Loaded \"{0}\" from plugin.", plugin.GetType ().Name);
285
} catch (Exception e) {
286
Log<PluginManager>.Error ("Encountered error loading plugin: {0} \"{1}\"",
287
e.GetType ().Name, e.Message);
288
Log<PluginManager>.Debug (e.StackTrace);
291
case ExtensionChange.Remove:
293
object plugin = node.GetInstance ();
294
Log<PluginManager>.Debug ("Unloaded \"{0}\".", plugin.GetType ().Name);
295
} catch (Exception e) {
296
Log<PluginManager>.Error ("Encountered error unloading plugin: {0} \"{1}\"",
297
e.GetType ().Name, e.Message);
298
Log<PluginManager>.Debug (e.StackTrace);
288
case ExtensionChange.Add:
290
object plugin = node.GetInstance ();
291
Log<PluginManager>.Debug ("Loaded \"{0}\" from plugin.", plugin.GetType ().Name);
292
} catch (Exception e) {
293
Log<PluginManager>.Error ("Encountered error loading plugin: {0} \"{1}\"",
294
e.GetType ().Name, e.Message);
295
Log<PluginManager>.Debug (e.StackTrace);
298
case ExtensionChange.Remove:
300
object plugin = node.GetInstance ();
301
Log<PluginManager>.Debug ("Unloaded \"{0}\".", plugin.GetType ().Name);
302
} catch (Exception e) {
303
Log<PluginManager>.Error ("Encountered error unloading plugin: {0} \"{1}\"",
304
e.GetType ().Name, e.Message);
305
Log<PluginManager>.Debug (e.StackTrace);