private void DoDataPlugin(ExtractItem extractItem, IEnumerable <DataParsePluginInfo> plugs) { if (_cancelToken.IsCancellationRequested) { return; } //1.匹配插件 var plug = _pluginAdapter.MatchPluginByApp(plugs, DataPump.Metadata, DataPump.Metadata.SourceStorePath, GetAppVersion(extractItem)); //2.执行插件 plug.SaveDbPath = DataPump.Metadata.DbFilePath; plug.Phone = DataPump.Metadata.Source as Device; Reporter?.ChangeProgress(extractItem.GUID, 0.45); _pluginAdapter.ExecutePlugin(plug, null, (ds) => { FinishExtractItem(extractItem, ds); }); }
/// <summary> /// 执行插件 /// </summary> /// <param name="extractItem"></param> /// <param name="plugs"></param> /// <returns></returns> private async Task DoDataPlug(ExtractItem extractItem, IEnumerable <DataParsePluginInfo> plugs) { await Task.Run(() => { WaitRunWorkThread(() => { //1.匹配插件 var plug = PluginAdapter.MatchPluginByApp(plugs, SourcePump, RootSourceDataPath, GetAppVersion(extractItem)); //2.执行插件 PluginAdapter.ExecutePlugin(plug, Asyn, (ds) => { //插件执行完处理 FinishExtractItem(extractItem, ds); }); }, () => { //TODO:取消插件执行后处理 }); }); }