public override object Execute(object arg, IAsyncTaskProgress progress) { var context = GetContext(); if (context == null) { throw new System.Exception("Dont find context!"); } DataParsePluginInfo p = PluginInfo as DataParsePluginInfo; return(context?.Execute(p.ScriptObject, progress)); }
public override object Execute(object arg, IAsyncTaskProgress progress) { var task = arg as SPFTask; DataParsePluginInfo p = PluginInfo as DataParsePluginInfo; var files = task.SourceFiles.Where(s => p.SourcePath.Any(k => k.Config == s.Config)); var str = string.Empty; if (files.IsValid()) { str = Serializer.JsonSerilize(files.Select(s => s.Local)); } var js = p.ScriptObject.Replace("$source", str); var obj = ExecuteJs(js, progress); return(null); }