/// <summary> /// Searchs an Assembly for registrable Services /// </summary> /// <param name="assembly">The Assembly that will be part of the search.</param> public void ScanAssembly(Assembly assembly) { if (Assemblies.Contains(assembly)) { return; } Assemblies.Add(assembly); var contextMappings = assembly.MapTypes <IContext>(); var serviceMappings = assembly.MapTypes <IService>(); var sharedServiceMappings = assembly.MapTypes <ISharedService>(); var instanceTypes = assembly.FindInterfaces <IInstance>(); var factoryTypes = assembly.FindInterfaces <IFactory>(true); var descriptorMappings = assembly.MapGenericTypes <IModelDescriptor>(true); Contexts.AddRange(contextMappings); Services.AddRange(serviceMappings); SharedServices.AddRange(sharedServiceMappings); Instances.AddRange(instanceTypes); Factories.AddRange(factoryTypes); Descriptors.AddRange(descriptorMappings); }
/// <summary>Add explicit instances</summary> public Plugins <TInterface> Add(IEnumerable <TInterface> inst) { Instances.AddRange(inst); return(this); }
public void AddInstances(IEnumerable <GGrassInstance> newInstances) { Instances.AddRange(newInstances); RecalculateBounds(); Changed(); }