Exemplo n.º 1
0
        public Startup(IShellConfiguration shellConfiguration)
        {
            var configurationSection = shellConfiguration.GetSection("OrchardCore.Media");

            _maxBrowserCacheDays = configurationSection.GetValue("MaxBrowserCacheDays", 30);
            _maxCacheDays        = configurationSection.GetValue("MaxCacheDays", 365);
        }
Exemplo n.º 2
0
        public Startup(IShellConfiguration shellConfiguration)
        {
            var configurationSection = shellConfiguration.GetSection("OrchardCore_Setup");

            _defaultCulture    = configurationSection["DefaultCulture"] ?? _defaultCulture;
            _supportedCultures = configurationSection.GetSection("SupportedCultures").Get <List <string> >()?.ToArray() ?? _supportedCultures;
        }
 public ConfiguredFeaturesShellDescriptorManager(
     IShellConfiguration shellConfiguration,
     IEnumerable <ShellFeature> shellFeatures)
 {
     _shellConfiguration    = shellConfiguration;
     _alwaysEnabledFeatures = shellFeatures.Where(f => f.AlwaysEnabled).ToArray();
 }
Exemplo n.º 4
0
        public Startup(IShellConfiguration shellConfiguration)
        {
            var configurationSection = shellConfiguration.GetSection("OrchardCore.Setup");

            _defaultCulture    = configurationSection["DefaultCulture"];
            _supportedCultures = configurationSection.GetSection("SupportedCultures").Get <string[]>();
        }
 public ConfigurationMethodProvider(IShellConfiguration configuration)
 {
     _globalMethod = new GlobalMethod
     {
         Name   = "configuration",
         Method = serviceprovider => (Func <string, object>)(name => configuration[name])
     };
 }
Exemplo n.º 6
0
 public ConfigurationMethodProvider(IShellConfiguration configuration)
 {
     _globalMethod = new GlobalMethod
     {
         Name   = "configuration",
         Method = serviceprovider => (Func <string, object, object>)((key, defaultValue) => configuration.GetValue <object>(key, defaultValue))
     };
 }
Exemplo n.º 7
0
        public Startup(IShellConfiguration shellConfiguration)
        {
            var configurationSection = shellConfiguration.GetSection("OrchardCore.Media");

            _supportedSizes      = configurationSection.GetSection("SupportedSizes").Get <int[]>() ?? DefaultSizes;
            _maxBrowserCacheDays = configurationSection.GetValue("MaxBrowserCacheDays", 30);
            _maxCacheDays        = configurationSection.GetValue("MaxCacheDays", 365);
        }
Exemplo n.º 8
0
 public MediaS3StorageOptionsConfiguration(
     IShellConfiguration shellConfiguration,
     ShellSettings shellSettings,
     ILogger <MediaS3StorageOptions> logger
     )
 {
     _shellConfiguration = shellConfiguration;
     _shellSettings      = shellSettings;
     _logger             = logger;
 }
 public HttpsSettingsUpdater(
     ISiteService siteService,
     IShellConfiguration shellConfiguration,
     IShellHost shellHost,
     ShellSettings shellSettings)
 {
     _siteService        = siteService;
     _shellConfiguration = shellConfiguration;
     _shellHost          = shellHost;
     _shellSettings      = shellSettings;
 }
Exemplo n.º 10
0
 public Startup(
     IShellConfiguration configuration,
     IOptions <ShellOptions> shellOptions,
     ShellSettings shellSettings,
     ILogger <Startup> logger)
 {
     _configuration = configuration;
     _shellOptions  = shellOptions;
     _shellSettings = shellSettings;
     _logger        = logger;
 }
Exemplo n.º 11
0
        public MediaFileProvider(
            IMediaFileStore mediaStore,
            IOptions <ImageSharpMiddlewareOptions> options,
            IShellConfiguration shellConfiguration)
        {
            _mediaStore      = mediaStore;
            _formatUtilities = new FormatUtilities(options.Value.Configuration);

            var configurationSection = shellConfiguration.GetSection("OrchardCore.Media");

            _supportedSizes = configurationSection.GetSection("SupportedSizes").Get <int[]>()?.OrderBy(s => s).ToArray() ?? DefaultSizes;
        }
Exemplo n.º 12
0
 public SmtpSettingsUpdater(
     ISiteService siteService,
     IDataProtectionProvider dataProtectionProvider,
     IShellConfiguration shellConfiguration,
     ILogger <SmtpSettingsUpdater> logger,
     ShellSettings shellSettings,
     IShellHost shellHost)
 {
     _siteService            = siteService;
     _dataProtectionProvider = dataProtectionProvider;
     _shellConfiguration     = shellConfiguration;
     _logger        = logger;
     _shellSettings = shellSettings;
     _shellHost     = shellHost;
 }
Exemplo n.º 13
0
 public ShellDescriptorManager(
     ShellSettings shellSettings,
     IShellConfiguration shellConfiguration,
     IEnumerable <ShellFeature> shellFeatures,
     IEnumerable <IShellDescriptorManagerEventHandler> shellDescriptorManagerEventHandlers,
     ISession session,
     ILogger <ShellDescriptorManager> logger)
 {
     _shellSettings         = shellSettings;
     _shellConfiguration    = shellConfiguration;
     _alwaysEnabledFeatures = shellFeatures.Where(f => f.AlwaysEnabled).ToArray();
     _shellDescriptorManagerEventHandlers = shellDescriptorManagerEventHandlers;
     _session = session;
     _logger  = logger;
 }
Exemplo n.º 14
0
 public AdminController(
     IMediaFileStore mediaFileStore,
     IAuthorizationService authorizationService,
     IContentTypeProvider contentTypeProvider,
     IShellConfiguration shellConfiguration,
     ILogger <AdminController> logger,
     IStringLocalizer <AdminController> stringLocalizer)
 {
     _mediaFileStore       = mediaFileStore;
     _authorizationService = authorizationService;
     _contentTypeProvider  = contentTypeProvider;
     _shellConfiguration   = shellConfiguration;
     _logger = logger;
     T       = stringLocalizer;
 }
 public ConfiguredFeaturesShellDescriptorManager(IShellConfiguration shellConfiguration, IEnumerable <ShellFeature> shellFeatures)
 {
     base();
     this._shellConfiguration = shellConfiguration;
     stackVariable4           = shellFeatures;
     stackVariable5           = ConfiguredFeaturesShellDescriptorManager.u003cu003ec.u003cu003e9__3_0;
     if (stackVariable5 == null)
     {
         dummyVar0      = stackVariable5;
         stackVariable5 = new Func <ShellFeature, bool>(ConfiguredFeaturesShellDescriptorManager.u003cu003ec.u003cu003e9.u003cu002ectoru003eb__3_0);
         ConfiguredFeaturesShellDescriptorManager.u003cu003ec.u003cu003e9__3_0 = stackVariable5;
     }
     this._alwaysEnabledFeatures = stackVariable4.Where <ShellFeature>(stackVariable5).ToArray <ShellFeature>();
     return;
 }
Exemplo n.º 16
0
 public ShellDescriptorManager(
     IServiceProvider serviceProvider,
     ShellSettings shellSettings,
     IShellConfiguration shellConfiguration,
     IEnumerable <ShellFeature> shellFeatures,
     IEnumerable <IShellDescriptorManagerEventHandler> shellDescriptorManagerEventHandlers,
     IDbContext context,
     ILogger <ShellDescriptorManager> logger)
 {
     _serviceProvider       = serviceProvider;
     _shellSettings         = shellSettings;
     _shellConfiguration    = shellConfiguration;
     _alwaysEnabledFeatures = shellFeatures.Where(f => f.AlwaysEnabled).ToArray();
     _shellDescriptorManagerEventHandlers = shellDescriptorManagerEventHandlers;
     _context = context;
     _logger  = logger;
 }
Exemplo n.º 17
0
 public Startup(IShellConfiguration shellConfiguration)
 {
     _shellConfiguration = shellConfiguration;
 }
 public MediaOptionsConfiguration(IShellConfiguration shellConfiguration)
 {
     _shellConfiguration = shellConfiguration;
 }
Exemplo n.º 19
0
 public Startup(IShellConfiguration configuration,
                ILogger <Startup> logger)
 => (_configuration, _logger)
Exemplo n.º 20
0
 public Startup(IOptions <AdminOptions> adminOptions, IShellConfiguration configuration)
 {
     _adminOptions  = adminOptions.Value;
     _configuration = configuration;
 }
Exemplo n.º 21
0
    public static AwsStorageOptions BindConfiguration(this AwsStorageOptions options, IShellConfiguration shellConfiguration)
    {
        var section = shellConfiguration.GetSection("OrchardCore_Media_AmazonS3");

        if (section == null)
        {
            return(options);
        }

        options.BucketName   = section.GetValue(nameof(options.BucketName), String.Empty);
        options.BasePath     = section.GetValue(nameof(options.BasePath), String.Empty);
        options.CreateBucket = section.GetValue(nameof(options.CreateBucket), false);

        var credentials = section.GetSection("Credentials");

        if (credentials.Exists())
        {
            options.Credentials = new AwsStorageCredentials
            {
                RegionEndpoint =
                    credentials.GetValue(nameof(options.Credentials.RegionEndpoint), RegionEndpoint.USEast1.SystemName),
                SecretKey   = credentials.GetValue(nameof(options.Credentials.SecretKey), String.Empty),
                AccessKeyId = credentials.GetValue(nameof(options.Credentials.AccessKeyId), String.Empty),
            };
        }
        else
        {
            // Attempt to load Credentials from Profile.
            var profileName = section.GetValue("ProfileName", String.Empty);
            if (!String.IsNullOrEmpty(profileName))
            {
                var chain = new CredentialProfileStoreChain();
                if (chain.TryGetProfile(profileName, out var basicProfile))
                {
                    var awsCredentials = basicProfile.GetAWSCredentials(chain)?.GetCredentials();
                    if (awsCredentials != null)
                    {
                        options.Credentials = new AwsStorageCredentials
                        {
                            RegionEndpoint = basicProfile.Region.SystemName ?? RegionEndpoint.USEast1.SystemName,
                            SecretKey      = awsCredentials.SecretKey,
                            AccessKeyId    = awsCredentials.AccessKey
                        };
                    }
                }
            }
        }

        return(options);
    }
Exemplo n.º 22
0
 public ReverseProxyStartup(IShellConfiguration shellConfiguration)
 {
     _shellConfiguration = shellConfiguration;
 }
Exemplo n.º 23
0
 public Startup(IOptions <AdminOptions> adminOptions, IShellConfiguration configuration)
 {
     _adminOptions  = adminOptions.Value;
     _configuration = configuration;
     IArchiveEntryExtensions.WriteToDirectory(null, null);
 }
Exemplo n.º 24
0
 public ContentPickerStartup(IShellConfiguration shellConfiguration)
 {
     _shellConfiguration = shellConfiguration;
 }
Exemplo n.º 25
0
 public Startup(ShellSettings shellSettings, IShellConfiguration configuration, ILogger <Startup> logger)
 {
     _tenant        = shellSettings.Name;
     _configuration = configuration;
     _logger        = logger;
 }
Exemplo n.º 26
0
 public Startup(IOptions <AdminOptions> adminOptions, ILogger <Startup> logger, IShellConfiguration configuration)
 {
     _adminOptions  = adminOptions.Value;
     _logger        = logger;
     _configuration = configuration;
 }
Exemplo n.º 27
0
 public Startup(IShellConfiguration configuration,
                IHostingEnvironment hostingEnvironment)
 {
     _configuration      = configuration;
     _hostingEnvironment = hostingEnvironment;
 }
Exemplo n.º 28
0
 public ShellContextOptionsSetup(IShellConfiguration shellConfiguration)
 {
     _shellConfiguration = shellConfiguration;
 }
Exemplo n.º 29
0
 public Startup(ILogger <Startup> logger, IShellConfiguration configuration)
 {
     _logger        = logger;
     _configuration = configuration;
 }
Exemplo n.º 30
0
 public DocumentOptionsSetup(IShellConfiguration shellConfiguration)
 {
     _shellConfiguration = shellConfiguration;
 }