internal RunnerRequirementsSnapshot(RunnerRequirements cfg) { _layers = new RequirementLayerSnapshot[cfg.Count]; int i = 0; foreach (RequirementLayer l in cfg) { _layers[i++] = new RequirementLayerSnapshot(l); } _final = cfg.CreateFinalConfigSnapshot(); }
public PluginRunner(IServiceProvider externalServiceProvider, IConfigManager cfg) { _externalServiceProvider = externalServiceProvider; _config = cfg; _configAccessors = new Dictionary <INamedVersionedUniqueId, PluginConfigAccessor>(); _config.Extended.Container.Changed += OnConfigContainerChanged; _discoverer = new PluginDiscoverer(); _runningConfig = new RunningConfiguration(this); _requirements = new RunnerRequirements(this); _host = new PluginHost(); // 0 - For creation. _host.PluginCreator = CreatePlugin; // 1 - Before Setup call: plugin is configured. _host.PluginConfigurator = ConfigurePlugin; // 2 - Before Start: plugin is aware of its environment. _host.ServiceReferencesBinder = ConfigureServiceReferences; }