Ejemplo n.º 1
0
        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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        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);
        }