Exemplo n.º 1
0
        public T Build <T>(IExtension extension)
        {
            T implementation = (T)_objectBuilderService.BuildTransient(extension.Implementation);

            IExtensionAware awareImplementation = implementation as IExtensionAware;

            if (awareImplementation != null)
            {
                awareImplementation.Configure(extension);
            }

            return(implementation);
        }
Exemplo n.º 2
0
 internal void Activate(IObjectBuilder builder)
 {
     if (!string.IsNullOrEmpty(_activatorClass))
     {
         try
         {
             _activatorInstance = builder.BuildTransient(_activatorClass);
         }
         catch (Exception exc)
         {
             _logger.FatalFormat(string.Concat("实例化 Bundle ", Id, " 时发生错误!."), exc);
         }
     }
 }