Beispiel #1
0
 public bool TryGetPlugin(string pluginID, out Plugin plugin)
 {
     return dicPluginInstances.TryGetValue(pluginID, out plugin);
 }
 public Plugin Load(string pluginID) {
     if(File.Exists(Path)) {
         try {
             PluginInformation information;
             if(dicPluginInformations.TryGetValue(pluginID, out information)) {
                 IPluginClient pluginClient = assembly.CreateInstance(information.TypeFullName) as IPluginClient;
                 if(pluginClient != null) {
                     Plugin plugin = new Plugin(pluginClient, information);
                     IBarButton button = pluginClient as IBarButton;
                     if(button != null) {
                         Image imageLarge = information.ImageLarge;
                         Image imageSmall = information.ImageSmall;
                         try {
                             Image image = button.GetImage(true);
                             Image image4 = button.GetImage(false);
                             if(image != null) {
                                 information.ImageLarge = image;
                                 if(imageLarge != null) {
                                     imageLarge.Dispose();
                                 }
                             }
                             if(image4 != null) {
                                 information.ImageSmall = image4;
                                 if(imageSmall != null) {
                                     imageSmall.Dispose();
                                 }
                             }
                         }
                         catch(Exception exception) {
                             PluginManager.HandlePluginException(exception, IntPtr.Zero, information.Name, "Getting image from pluging.");
                             throw;
                         }
                     }
                     return plugin;
                 }
             }
         }
         catch(Exception exception2) {
             QTUtility2.MakeErrorLog(exception2, null);
         }
     }
     return null;
 }
Beispiel #3
0
 public static bool TryGetStaticPluginInstance(string pid, out Plugin plugin)
 {
     return dicStaticPluginInstances.TryGetValue(pid, out plugin);
 }