public IActionResult GetColorsForAdmin([FromQuery] ColorParams colorParams)
 {
     try
     {
         var colors = _repo.GetColors(colorParams);
         Response.AddPagination(colors.CurrentPage, colors.PageSize, colors.TotalCount, colors.TotalPages);
         return(Ok(colors));
     }
     catch (Exception ex)
     {
         return(BadRequest("Κάτι πήγε στραβά"));
     }
 }
        public void SetColorParam(ColorParams param, double value)
        {
            clrParams[(int)param] = value;

            if (param == ColorParams.Saturation)
            {
                Saturation = clrParams[(int)ColorParams.Saturation];
            }
            else
            {
                UpdateColorLut();
            }
        }
예제 #3
0
            public SetColor(string color, bool expectReply = false)
            {
                Name = "setColor";

                if (expectReply)
                {
                    Params = new ColorReplyParams()
                    {
                        Color = color, ExpectReply = expectReply
                    }
                }
                ;
                else
                {
                    Params = new ColorParams()
                    {
                        Color = color
                    }
                };
            }
예제 #4
0
        public PagedList <Color> GetColors(ColorParams colorParams)
        {
            var colors = _ctx.Color.OrderBy(x => x.Title);

            return(PagedList <Color> .Create(colors, colorParams.PageNumber, colorParams.PageSize));
        }