Scan single types, not assemblies.
This commit is contained in:
parent
78bed400ee
commit
8e57233dad
@ -42,13 +42,22 @@ namespace Voile.Patchouli.Reflection
|
||||
Type[] types = assembly.GetTypes();
|
||||
foreach (Type t in types)
|
||||
{
|
||||
if (ScanType(t))
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool ScanType(Type t)
|
||||
{
|
||||
|
||||
VoilePluginAttribute? voilePluginAttribute = t.GetCustomAttribute<VoilePluginAttribute>();
|
||||
if (voilePluginAttribute == null)
|
||||
continue;
|
||||
return false;
|
||||
|
||||
VoilePluginIdAttribute? voilePluginIdAttribute = t.GetCustomAttribute<VoilePluginIdAttribute>();
|
||||
if (voilePluginIdAttribute == null)
|
||||
continue;
|
||||
return false;
|
||||
|
||||
VoilePluginInfo child = new VoilePluginInfo(t);
|
||||
child.Id = voilePluginIdAttribute.Id;
|
||||
@ -59,8 +68,7 @@ namespace Voile.Patchouli.Reflection
|
||||
_knownDataStorages = new List<VoilePluginInfo>();
|
||||
child.Subsystem = VoileSubsystemType.DataStorage;
|
||||
_knownDataStorages.Add(child);
|
||||
result = true;
|
||||
continue;
|
||||
return true;
|
||||
}
|
||||
else if (t.IsAssignableTo(_objectStorageFactoryType))
|
||||
{
|
||||
@ -68,15 +76,12 @@ namespace Voile.Patchouli.Reflection
|
||||
_knownObjectStorages = new List<VoilePluginInfo>();
|
||||
child.Subsystem = VoileSubsystemType.ObjectStorage;
|
||||
_knownObjectStorages.Add(child);
|
||||
result = true;
|
||||
continue;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
throw new VoileReflectionException(String.Format("Could not figure out plugin type of {0}", t.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user