Пример #1
0
        private Context(bool proxified)
        {
            _serviceContainer = new ContextServiceContainer(this);
            _dic           = SharedDictionary.Create(_serviceContainer);
            _configManager = ConfigurationManager.Create(_dic);
            _reqLayer      = new RequirementLayer("Context");

            _pluginRunner = new PluginRunner(_serviceContainer, _configManager.ConfigManager);
            _serviceContainer.Add(RequirementLayerSerializer.Instance);
            _serviceContainer.Add(SimpleTypeFinder.Default);

            if (proxified)
            {
                _proxifiedContext = (IContext)_pluginRunner.ServiceHost.InjectExternalService(typeof(IContext), this);
            }
            else
            {
                _proxifiedContext = this;
                _serviceContainer.Add <IContext>(this);
            }
            _pluginRunner.Initialize(_proxifiedContext);
        }