private void OnJobDone(object sender, ScanResult args)
        {
            Console.WriteLine("Job done.  Found " + args.Clones.Count + " cloens.");

            scanResult = args;
        }
 private void InvokeJobDone(ScanResult args)
 {
     JobDoneEvent @event = JobDone;
     if (@event != null) @event(this, args);
 }
        public void UpdateCodeText(string codeText)
        {
            if (Job != null)
            {
                Job.Terminate();
                scanResult = null; // ditch any previous results.

                // Abandon to the garbage collector.
                Job = null;
            }

            CodeText = codeText;

            Job = new CloneFinderJob(codeText);
            Job.JobDone += OnJobDone;

            Job.Start();
        }