Exemplo n.º 1
0
        public static bool CheckMacro(Macro m)
        {
            if (m == null)
            {
                return(false);
            }

            foreach (ModelBase item in m.WorkItems)
            {
                if (item is PluginModel)
                {
                    PluginModel pluginItem = (PluginModel)item;
                    string      plugin     = pluginItem.Plugin;

                    IPhotoTagStudioTaggingPlugin p = PluginView.GetPlugin(plugin);
                    if (p == null)
                    {
                        if (MessageBox.Show("The macro uses a plugin that cannot be found by PhotoTagStudio: " + plugin + "\n\nUse the macro anyway?", "Plugin for macro not found", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        public override bool ProcessFile(PictureMetaData pmd, PluginModel model)
        {
            IPhotoTagStudioTaggingPlugin plugin;

            if (cache.ContainsKey(model.Plugin))
            {
                plugin = cache[model.Plugin];
            }
            else
            {
                plugin = PluginView.GetPlugin(model.Plugin);
                cache.Add(model.Plugin, plugin);
            }

            if (plugin != null)
            {
                return(plugin.ProcessFile(pmd));
            }

            return(false);
        }