public AzureImageProvider()
    {
        ImageProviderSection imageProviderSection = ConfigurationManager.GetSection(ImageProviderSection.ImageProviderConfigurationSection) as ImageProviderSection;

        _azureKey           = imageProviderSection.AzureImageProvider.AzureKey;
        _storageAccountName = imageProviderSection.AzureImageProvider.StorageAccountName;
    }
    public FSImageProvider()
    {
        ImageProviderSection imageProviderSection = ConfigurationManager.GetSection(ImageProviderSection.ImageProviderConfigurationSection) as ImageProviderSection;

        _directory = imageProviderSection.FSImageProvider.Directory.Trim();
        if (!_directory.EndsWith("\\"))
        {
            _directory += "\\";
        }
    }
Пример #3
0
    public static IImageProvider GetImageProvider()
    {
        ImageProviderSection imageProviderSection = ConfigurationManager.GetSection(ImageProviderSection.ImageProviderConfigurationSection) as ImageProviderSection;

        switch (imageProviderSection.ImageProvider.Name)
        {
        case ImageProviderSection.FSImageProviderProperty:
            return(new FSImageProvider());

        case ImageProviderSection.AzureImageProviderProperty:
            return(new AzureImageProvider);

        default:
            throw new Exception("Invalid image provider in configuration");
        }
    }