Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HomeController"/> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="settings">The settings.</param>
        public HomeController(
            IWebHostEnvironment environment,
            ILogger <HomeController> logger,
            IOptions <AppSettings> settings
            )
        {
            this.Environment = environment;
            this.Logger      = logger;
            this.AppSettings = settings.Value;

            if (string.Equals("external", this.AppSettings?.UseGenerator, StringComparison.OrdinalIgnoreCase))
            {
                this.Encoder = new BySquareExternalEncoder(this.AppSettings?.ExternalGenerator, this.Logger);
            }
            else
            {
                this.Encoder = new BySquareInternalEncoder();
            }
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExcelManipulator"/> class.
 /// </summary>
 /// <param name="bySquareEncoder">The BySquare encoder.</param>
 /// <param name="imageManipulator">The image manipulator.</param>
 /// <param name="progressReporter">The progress reporter.</param>
 public ExcelManipulator(IBySquareEncoder bySquareEncoder, IImageManipulator imageManipulator, IProgress <int> progressReporter) : this(progressReporter)
 {
     this.BySquareEncoder  = bySquareEncoder;
     this.ImageManipulator = imageManipulator;
 }