示例#1
0
        //public AddinEngine() : this(AddinOptions.Create()) { }

        public AddinEngine(AddinOptions addinOptions)
        {
            _addinRelationManager   = new AddinRelationManager();
            _addinFramework         = new AddinFramework(addinOptions);
            _assemblyResolver       = new RuntimeAssemblyResolver(_addinFramework);
            _runtimeExtensionLoader = new RuntimeExtensionLoader(_assemblyResolver, _addinFramework.ExtensionPointFactory, _addinFramework.ExtensionBuilderFactory);
        }
示例#2
0
        internal AddinFramework(AddinOptions options)
        {
            _repository = new AddinRepository();

            _messageDialog      = options.MessageDialog ?? new DefaultMessageDialog();
            _nameConvention     = options.NameConvention ?? new DefaultNameConvention();
            _fileSettings       = options.FileSettings ?? new AddinFileSettings();
            _assemblyLoadPolicy = options.AssemblyLoadPolicy ?? new DefaultAssemblyLoadPolicy();
            _ebFactory          = options.ExtensionBuilderFactory ?? new ReflectionExtensionBuilderFactory();
            _epFactory          = options.ExtensionPointFactory ?? new ReflectionExtensionPointFactory();
            _eventBroker        = options.EventBroker ?? new EventBroker(new EventBrokerOption());
            _serviceProvider    = options.ServiceProvider ?? new DefaultServiceProvider();
            _stringLocalizer    = options.StringLocalizer ?? new DefaultStringLocalizer();

            LogManager.Initialize(new FileLogSetting(_fileSettings.DataDirectory, AddinFileSettings.LogFileName));
            _logger = LogManager.GetDefaultLogger();

            _properties = new Dictionary <HashKey, object>();
        }