-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (23 loc) · 1.04 KB
/
Program.cs
File metadata and controls
25 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using KY.Core;
using KY.Core.Dependency;
using KY.Core.Module;
namespace ModuleExample
{
// Build everything to the same bin folder, oder reference the assembly
// Not referenced assemblys are not build automatically from VS. So build by hand or disable option Tools > Options > Projects and Solutions > Build and Run > Only build startup projects and dependencies on Run
internal class Program
{
private static void Main(string[] args)
{
DependencyResolver resolver = new DependencyResolver();
ModuleFinder finder = new ModuleFinder(resolver);
// Load all assemblies with names like *.Module.dll or *.Modules.dll
finder.LoadFrom(AppDomain.CurrentDomain.BaseDirectory);
// If all modules are in the same assembly or all assemblies are referenced, you can use LoadFromAssemblies instead of LoadFrom
//finder.LoadFromAssemblies();
finder.Modules.ForEach(module => module.Initialize());
Console.ReadLine();
}
}
}