public void LoadClasses()
 {
     assembleClasses.LoadClasses();
     ClassesNames = assembleClasses.ClassesNames;
     var args = new AssembleClassesEventArgs(ClassesNames);
     OnClassesLoaded?.Invoke(this, args);
 }
        public void Interrupt()
        {
            tokenSource.Cancel();
            isStarted = false;
            var args = new AssembleClassesEventArgs(ClassesNames);

            OnInterrupted?.Invoke(this, args);
        }
        public virtual void UpdateAlgorithmKeys(object sender, AssembleClassesEventArgs e)
        {
            var currentLoadedPluginsKeys = e.ClassesNames.ToArray();
            var addedAlgorithms          = currentLoadedPluginsKeys.Except(AlgorithmKeys).ToArray();
            var deletedAlgorithms        = AlgorithmKeys.Except(currentLoadedPluginsKeys.AsEnumerable()).ToArray();

            if (addedAlgorithms.Any())
            {
                AlgorithmKeys.AddRange(addedAlgorithms);
            }
            if (deletedAlgorithms.Any())
            {
                AlgorithmKeys.RemoveRange(deletedAlgorithms);
            }
            if (addedAlgorithms.Any() || deletedAlgorithms.Any())
            {
                AlgorithmKeys = AlgorithmKeys.OrderBy(key => key).ToList();
            }
        }