Example #1
0
 public ExportContext(IScoreBookExportPlugin plugin, string dest, bool isQuick, Func <string> getCustomData, Action <string> setCustomData)
 {
     ExportPlugin  = plugin;
     IsQuick       = isQuick;
     OutputPath    = dest;
     GetCustomData = getCustomData;
     SetCustomData = setCustomData;
 }
Example #2
0
        protected void ExportAs(IScoreBookExportPlugin exportPlugin)
        {
            var dialog = new SaveFileDialog()
            {
                Filter = exportPlugin.FileFilter
            };

            if (dialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            HandleExport(ScoreBook, ExportManager.PrepareExport(exportPlugin, dialog.FileName));
        }
Example #3
0
 protected string ResolvePluginName(IScoreBookExportPlugin plugin) => plugin.GetType().FullName;
Example #4
0
        protected ExportContext PrepareExport(IScoreBookExportPlugin plugin, string dest, bool isQuick)
        {
            string name = ResolvePluginName(plugin);

            return(new ExportContext(plugin, dest, isQuick, () => CustomDataCache.ContainsKey(name) ? CustomDataCache[name] : "", data => CustomDataCache[name] = data));
        }
Example #5
0
 public ExportContext PrepareExport(IScoreBookExportPlugin plugin, string dest)
 {
     return(PrepareExport(plugin, dest, false));
 }
Example #6
0
 public Exporter(IScoreBookExportPlugin plugin, ScoreBookExportPluginArgs args)
 {
     LastUsedPlugin = plugin;
     LastUsedArgs   = args;
 }