public void RaiseDetector(Download download) { if (!Running) { return; } var e = new DetectorEvent(download); OnDetector?.Invoke(this, e, EventArgs.Empty); foreach (var wi in client.WorkflowInstances.ToList()) { if (wi.isCompleted) { continue; } if (wi.Bookmarks != null) { foreach (var b in wi.Bookmarks) { if (b.Key == "DownloadDetectorPlugin") { wi.ResumeBookmark(b.Key, e); } } } } }
private static void downloadcomplete(NativeMessagingMessage msg) { var json = msg.data; var download = JsonConvert.DeserializeObject <Download>(json); foreach (var p in Plugins.detectorPlugins) { if (p is DownloadDetectorPlugin plugin) { plugin.RaiseDetector(download); } } var e = new DetectorEvent(download); foreach (var wi in Plugin.client.WorkflowInstances.ToList()) { if (wi.isCompleted) { continue; } if (wi.Bookmarks != null) { foreach (var b in wi.Bookmarks) { if (b.Key == "DownloadDetectorPlugin") { wi.ResumeBookmark(b.Key, e); } } } } }
public void RaiseDetector(Download download) { if (!Running) { return; } var e = new DetectorEvent(download); OnDetector?.Invoke(this, e, EventArgs.Empty); }