Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of BdoExtensionStoreLoader the class.
        /// </summary>
        /// <param name="appDomain">The application domain to consider.</param>
        /// <param name="store">The extension store to consider.</param>
        /// <param name="loadOptions">The load options to consider.</param>
        public BdoExtensionStoreLoader(AppDomain appDomain, IBdoExtensionStore store, IExtensionLoadOptions loadOptions)
        {
            _appDomain = appDomain;
            _store     = store;

            if (loadOptions == null)
            {
                loadOptions = new ExtensionLoadOptions().WithSourceKinds(DatasourceKind.Memory);
            }
            _loadOptions = loadOptions;
        }
Ejemplo n.º 2
0
        // ------------------------------------------
        // MUTATORS
        // ------------------------------------------

        #region Mutators

        /// <summary>
        /// Loads the specified extensions.
        /// </summary>
        /// <param name="loadOptionsAction">The load options action to consider.</param>
        /// <param name="references">The extension references to consider.</param>
        public IBdoLog LoadExtensions(
            Action <IExtensionLoadOptions> loadOptionsAction,
            params IBdoExtensionReference[] references)
        {
            IExtensionLoadOptions loadOptions = null;

            if (loadOptionsAction != null)
            {
                loadOptions = new ExtensionLoadOptions();
                loadOptionsAction?.Invoke(loadOptions);
            }
            var loader = new BdoExtensionStoreLoader(AppDomain, ExtensionStore, loadOptions);
            var log    = loader.LoadExtensionsInStore(references);

            return(log);
        }