コード例 #1
0
ファイル: PluginServer.cs プロジェクト: svn2github/QTTabBar
 public bool TryGetPlugin(string pluginID, out Plugin plugin)
 {
     return dicPluginInstances.TryGetValue(pluginID, out plugin);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: PluginManager.cs プロジェクト: Nicologies/QTTabBar
 public static bool TryGetStaticPluginInstance(string pid, out Plugin plugin)
 {
     return dicStaticPluginInstances.TryGetValue(pid, out plugin);
 }