~ubuntu-branches/ubuntu/trusty/gnome-do/trusty

« back to all changes in this revision

Viewing changes to Do/src/Do.Core/PluginManager.cs

  • Committer: Package Import Robot
  • Author(s): Christopher James Halse Rogers
  • Date: 2012-03-26 11:12:21 UTC
  • mfrom: (0.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120326111221-1jk143fy37zxi3e4
Tags: 0.9-1
* New upstream version no longer uses deprecated internal glib headers.
  (Closes: #665537)
* [59fa37b9] Fix watch file
* [63486516] Imported Upstream version 0.9
* [8c636d84] Disable testsuite for now; requires running dbus and gconf daemons
* [e46de4b9] Remove inaccurate README.Source
* [4591d677] Add git-buildpackage configuration to default to pristine-tar

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        {
47
47
                const string DefaultPluginIcon = "folder_tar";
48
48
                
49
 
                static IEnumerable<string> ExtensionPaths = new [] { "/Do/ItemSource", "/Do/Action" };
 
49
                static IEnumerable<string> ExtensionPaths = new [] { "/Do/ItemSource", "/Do/Action", "/Do/DynamicItemSource" };
50
50
 
51
51
                public static readonly IEnumerable<AddinClassifier> Classifiers =
52
52
                        new AddinClassifier [] {
204
204
                        get { return AddinManager.GetExtensionObjects ("/Do/ItemSource").OfType<ItemSource> (); }
205
205
                }
206
206
 
 
207
                /// <summary>
 
208
                /// All loaded DynamicItemSources.
 
209
                /// </summary>
 
210
                public static IEnumerable<DynamicItemSource> DynamicItemSources {
 
211
                        get { return AddinManager.GetExtensionObjects ("/Do/DynamicItemSource").OfType<DynamicItemSource> (); }
 
212
                }
 
213
 
207
214
                /// <value>
208
215
                /// All loaded Actions.
209
216
                /// </value>
276
283
                static void OnPluginChanged (object sender, ExtensionNodeEventArgs args)
277
284
                {
278
285
                        TypeExtensionNode node = args.ExtensionNode as TypeExtensionNode;
279
 
                        
 
286
 
280
287
                        switch (args.Change) {
281
 
                        case ExtensionChange.Add:
282
 
                                try {
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);
289
 
                                }
290
 
                                break;
291
 
                        case ExtensionChange.Remove:
292
 
                                try {
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);
299
 
                                }
300
 
                                break;
 
288
                                case ExtensionChange.Add:
 
289
                                        try {
 
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);
 
296
                                        }
 
297
                                        break;
 
298
                                case ExtensionChange.Remove:
 
299
                                        try {
 
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);
 
306
                                        }
 
307
                                        break;
301
308
                        }       
302
309
                }
303
310