mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
29 lines
891 B
C#
29 lines
891 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using System.Windows.Forms;
|
|
|
|
namespace PlugsInspector
|
|
{
|
|
public class AssembliesPreloader
|
|
{
|
|
public static void LoadAllAssemblies()
|
|
{
|
|
AllFilesInApplicationFolder().ForEach(fi => Assembly.LoadFrom(fi.FullName));
|
|
}
|
|
|
|
public static List<FileInfo> AllDllFilesIn(string path, bool recursively = false)
|
|
{
|
|
return new DirectoryInfo(path)
|
|
.EnumerateFiles("*.dll", recursively ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly).ToList();
|
|
}
|
|
public static List<FileInfo> AllFilesInApplicationFolder()
|
|
{
|
|
return AllDllFilesIn(Path.GetDirectoryName(Application.ExecutablePath), true);
|
|
}
|
|
}
|
|
}
|