Adds configure/initialize for internal assembly (#274)
This commit is contained in:
parent
683e2d6679
commit
ae523fe158
1 changed files with 19 additions and 7 deletions
|
|
@ -44,14 +44,11 @@ namespace Server
|
|||
{
|
||||
var invoke = new List<MethodInfo>();
|
||||
|
||||
for (var a = 0; a < Assemblies.Length; ++a)
|
||||
Core.Assembly.AddMethods(method, invoke);
|
||||
|
||||
for (var i = 0; i < Assemblies.Length; i++)
|
||||
{
|
||||
invoke.AddRange(
|
||||
Assemblies[a]
|
||||
.GetTypes()
|
||||
.Select(t => t.GetMethod(method, BindingFlags.Static | BindingFlags.Public))
|
||||
.Where(m => m != null)
|
||||
);
|
||||
Assemblies[i].AddMethods(method, invoke);
|
||||
}
|
||||
|
||||
invoke.Sort(new CallPriorityComparer());
|
||||
|
|
@ -62,6 +59,21 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
private static void AddMethods(this Assembly assembly, string method, List<MethodInfo> list)
|
||||
{
|
||||
var types = assembly.GetTypes();
|
||||
|
||||
for (int i = 0; i < types.Length; i++)
|
||||
{
|
||||
var m = types[i].GetMethod(method, BindingFlags.Static | BindingFlags.Public);
|
||||
if (m != null)
|
||||
{
|
||||
list.Add(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static TypeCache GetTypeCache(Assembly asm)
|
||||
{
|
||||
if (asm == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue