コード例 #1
0
        private static Yield Create_Helper(Plug dekiApi, XDoc exports, int exportRelto, string exportReltoPath, int importRelto, string importReltoPath, bool forceOverwrite, Result <BulkCopy> result)
        {
            Result <Exporter> exporterResult;

            if (string.IsNullOrEmpty(exportReltoPath))
            {
                yield return(exporterResult = Exporter.CreateAsync(dekiApi, exports, exportRelto, new Result <Exporter>()));
            }
            else
            {
                yield return(exporterResult = Exporter.CreateAsync(dekiApi, exports, exportReltoPath, new Result <Exporter>()));
            }
            Exporter          exporter = exporterResult.Value;
            Result <Importer> importerResult;

            if (string.IsNullOrEmpty(importReltoPath))
            {
                yield return(importerResult = Importer.CreateAsync(dekiApi, exporter.Manifest, importRelto, forceOverwrite, new Result <Importer>()));
            }
            else
            {
                yield return(importerResult = Importer.CreateAsync(dekiApi, exporter.Manifest, importReltoPath, forceOverwrite, new Result <Importer>()));
            }
            BulkCopy bulkCopy = new BulkCopy(exporter, importerResult.Value);

            result.Return(bulkCopy);
        }
コード例 #2
0
ファイル: BulkCopy.cs プロジェクト: heran/DekiWiki
 private static Yield Create_Helper(Plug dekiApi, XDoc exports, int exportRelto, string exportReltoPath, int importRelto, string importReltoPath, bool forceOverwrite, Result<BulkCopy> result) {
     Result<Exporter> exporterResult;
     if(string.IsNullOrEmpty(exportReltoPath)) {
         yield return exporterResult = Exporter.CreateAsync(dekiApi, exports, exportRelto, new Result<Exporter>());
     } else {
         yield return exporterResult = Exporter.CreateAsync(dekiApi, exports, exportReltoPath, new Result<Exporter>());
     }
     Exporter exporter = exporterResult.Value;
     Result<Importer> importerResult;
     if(string.IsNullOrEmpty(importReltoPath)) {
         yield return importerResult = Importer.CreateAsync(dekiApi, exporter.Manifest, importRelto, forceOverwrite, new Result<Importer>());
     } else {
         yield return importerResult = Importer.CreateAsync(dekiApi, exporter.Manifest, importReltoPath, forceOverwrite, new Result<Importer>());
     }
     BulkCopy bulkCopy = new BulkCopy(exporter, importerResult.Value);
     result.Return(bulkCopy);
 }