コード例 #1
0
ファイル: Startup.cs プロジェクト: toaderflorin/images
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            services.AddSingleton <IConfiguration>(Configuration);

            var section       = Configuration.GetSection("ProfilesConfig").Get <ProfilesConfiguration>();
            var imagesService = new ColorProfilesService(section);

            services.AddSingleton <ColorProfilesService>(imagesService);
        }
コード例 #2
0
        public void Startup()
        {
            _redProfile = new ColorProfile {
                Name = "red", R = 255, G = 0, B = 0
            };
            _greenProfile = new ColorProfile {
                Name = "green", R = 60, G = 170, B = 20
            };

            var config = new ProfilesConfiguration
            {
                Tolerance = 20,
                Profiles  = new ColorProfile[]
                {
                    _redProfile,
                    _greenProfile
                }
            };

            _service = new ColorProfilesService(config);
        }
コード例 #3
0
 public ColorProfilesController(ColorProfilesService imagesService)
 {
     _colorProfilesService = imagesService;
 }